CN103914326B - Method and device for efficiently updating JAVA instruction - Google Patents

Method and device for efficiently updating JAVA instruction Download PDF

Info

Publication number
CN103914326B
CN103914326B CN201410160741.6A CN201410160741A CN103914326B CN 103914326 B CN103914326 B CN 103914326B CN 201410160741 A CN201410160741 A CN 201410160741A CN 103914326 B CN103914326 B CN 103914326B
Authority
CN
China
Prior art keywords
data
address
length
category information
bag
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
Application number
CN201410160741.6A
Other languages
Chinese (zh)
Other versions
CN103914326A (en
Inventor
陆舟
于华章
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Feitian Technologies Co Ltd
Original Assignee
Feitian Technologies Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Feitian Technologies Co Ltd filed Critical Feitian Technologies Co Ltd
Priority to CN201410160741.6A priority Critical patent/CN103914326B/en
Publication of CN103914326A publication Critical patent/CN103914326A/en
Application granted granted Critical
Publication of CN103914326B publication Critical patent/CN103914326B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a method and a device for efficiently updating a JAVA instruction. The method includes the steps: acquiring revised data of a relevant address component by a JAVA intelligent card from an application protocol data unit, and acquiring an index value in a constant pool component from a storage area according to the revised data; acquiring current item data in the constant pool component by the JAVA intelligent card according to the acquired index value in the constant pool component, judging a reference type of the JAVA instruction corresponding to the current item data by the JAVA intelligent card, acquiring a deviation value according to a first preset portion of the current item data if the reference type is internal reference, acquiring a first parameter according to the deviation value and a component initial address corresponding to the instruction, acquiring a derived table address of a packet according to a second preset portion of the current item data if the reference type is external reference, and acquiring the first parameter according to the current item data in a derived table of the packet; updating instruction parameters of the JAVA instruction by the JAVA intelligent card according to the first parameter.

Description

A kind of method and apparatus of efficient renewal JAVA instruction
Technical field
The present invention relates to field of information processing, the method and apparatus of more particularly, to a kind of efficient renewal JAVA instruction.
Background technology
For JAVA smart card, the downloading process of application program is the process that CAP file is written to EEPROM, that is, It is the downloading process to CAP file.
In prior art, in the downloading process of CAP file, JAVA smart card first have to according to card outer quote calculate by The physical address of reference data, in the corresponding sublist then filled physical address, further according to physical address in master meter and son Index in table obtains quoting of this physical address, not only needs to carry out resetting bit manipulation, and is also performed to the step filled in a form, Downloading process is complicated;JAVA card virtual machine then needs according to fiducial value by way of searching master meter and sublist when execution Find the data of reality, the speed that JAVA card virtual machine accesses data in the process of implementation is low.
Content of the invention
The invention aims to overcoming the deficiencies in the prior art, provide a kind of method of efficient renewal JAVA instruction and Device, simplifies handling process in the downloading process of CAP file for the JAVA smart card.
The method of a kind of efficient renewal JAVA instruction that the present invention provides, including:
Step S1:JAVA smart card obtains the correction data of relative address assembly from Application Protocol Data Unit, according to Described correction data obtains the index value in constant pool component from JAVA smart cards for storage area;
Step S2:Described JAVA smart card is according to the index value in the described constant pool component getting in described constant pool Obtain current item data in assembly, judge whether to get current item data, be then execution step S3, otherwise return mistake letter Breath, terminates;
Step S3:According to the 1st byte of current item data, described JAVA smart card judges that current item data is corresponding The reference type of JAVA instruction, if internal reference then execution step S4, if external reference then execution step S5;
Step S4:Described JAVA smart card obtains deviant according to the first predetermined fraction of current item data, according to described Deviant and described JAVA instruct corresponding assembly initial address and obtain the first parameter, execution step S6;
Step S5:Described JAVA smart card obtains the derivation table address wrapping according to the second predetermined fraction of current item data, First parameter, execution step S6 are obtained in the derived table of bag according to the table address of deriving of current item data and described bag;
Step S6:Described JAVA smart card updates the order parameter of described JAVA instruction according to described first parameter, terminates.
Include before described step S1:
Step S0-1:Described JAVA smart card obtains institute according to reading address from the Application Protocol Data Unit receiving The length data stating correction data in relative address assembly as untreatment data length, according to the described length number getting According to length update described reading address;The initial value of described reading address is the correction data in described relative address assembly The first address of length data;
Step S0-2:Described JAVA smart card judges whether untreated correction according to described untreatment data length Data, is then execution step S1, otherwise returns success, and terminates;
Described step S1 is specially:Described JAVA smart card is according to described reading address from described Application Protocol Data Unit The middle correction data obtaining described relative address assembly, obtains constant according to described correction data from JAVA smart cards for storage area Index value in the assembly of pond, according to the correction data of the described relative address assembly reading, updates described untreatment data long Degree and described reading address;
Include after described step S6:
Step S7:Described JAVA smart card judges the described relative address in this Application Protocol Data Unit receiving Whether the data of assembly is treated to complete, and is to return success, waits and receive the next one and comprise described relative address The Application Protocol Data Unit of the data of assembly, return to step S0-2, otherwise return to step S0-2.
The length data of the described correction data in described relative address assembly includes the length number of single byte correction data According to the length button with double byte correction data;
Described step S0-1 is specially to step S1:
Step s1-1:Described JAVA smart card obtains institute according to reading address from the Application Protocol Data Unit receiving The length data stating single byte correction data in relative address assembly as the first untreatment data length, according to get The length of described length data updates described reading address;The initial value of described reading address is in described relative address assembly The first address of the length data of single byte correction data;
Step s1-2:Described JAVA smart card judges whether untreated according to described first untreatment data length Single byte correction data, is then execution step s1-3, otherwise execution step s1-6;
Step s1-3:Described JAVA smart card obtains institute according to described reading address from described Application Protocol Data Unit The data stating 1 byte of relative address assembly revises data as first, according in the described relative address assembly reading Data, update described first untreatment data length and described reading address;
Step s1-4:Described JAVA smart card updates, according to the described first correction data, the first physics being relocated data Address;The initial value of described the first physical address being relocated data is the method assembly base of described JAVA smart cards for storage Location;
Step s1-5:Described JAVA smart card is according to described the first physical address being relocated data from described JAVA intelligence The data of 1 byte can be obtained as the index value in constant pool component, execution step S4 in card memory area;
Step s1-6:Described JAVA smart card judges whether to obtain the length data of double byte correction data as second Untreatment data length, is then execution step s1-7, otherwise described JAVA smart card according to described reading address from described reception To Application Protocol Data Unit in obtain described relative address assembly double byte correction data length data as second Untreatment data length, the length according to the described length data getting updates described reading address, execution step s1-7;
Step s1-7:Described JAVA smart card judges whether untreated according to described second untreatment data length Double byte correction data, is then execution step s1-8, otherwise returns success, and terminates;
Step s1-8:Described JAVA smart card obtains institute according to described reading address from described Application Protocol Data Unit The data of 1 byte stating relative address assembly is as the second correction data;According in the described relative address assembly reading Data, update described second untreatment data length and described reading address;
Step s1-9:Described JAVA smart card updates, according to the described second correction data, the second physics being relocated data Address;The initial value of described the second physical address being relocated data is the method assembly base of described JAVA smart cards for storage Location;
Step s1-10:Described JAVA smart card is according to described the second physical address being relocated data from described JAVA The data of 2 bytes is obtained as the index value in constant pool component, execution step S2 in smart cards for storage area.
The length of time of the described correction data in described relative address assembly includes the length number of single byte correction data According to the length data with double byte correction data;
Described step S0-1 is specially to step S1:
Step s2-1:Described JAVA smart card obtains institute according to reading address from the Application Protocol Data Unit receiving The length data stating double byte correction data in relative address assembly as the first untreatment data length, according to get The length of described length data updates described reading address;The initial value of described reading address is in described relative address assembly The first address of the length data of double byte correction data;
Step s2-2:Described JAVA smart card judges whether untreated according to described first untreatment data length Double byte correction data, is then execution step s2-3, otherwise execution step s2-6;
Step s2-3:Described JAVA smart card obtains institute according to described reading address from described Application Protocol Data Unit The data stating 1 byte of relative address assembly revises data as first, according in the described relative address assembly reading Data, update described first untreatment data length and described reading address;
Step s2-4:Described JAVA smart card updates, according to the described first correction data, the first physics being relocated data Address;The initial value of described the first physical address being relocated data is the method assembly base of described JAVA smart cards for storage Location;
Step s2-5:Described JAVA smart card is according to described the first physical address being relocated data from described JAVA intelligence The data of 2 bytes can be obtained as the index value in constant pool component, execution step S4 in card memory area;
Step s2-6:Described JAVA smart card judges whether to obtain the length data of single byte correction data as second Untreatment data length, is then execution step s2-7, otherwise described JAVA smart card according to described reading address from described reception To Application Protocol Data Unit in obtain described relative address assembly single byte correction data length data as second Untreatment data length, the length according to the described length data getting updates described reading address, execution step s2-7;
Step s2-7:Described JAVA smart card judges whether untreated according to described second untreatment data length Single byte correction data, is then execution step s2-8, otherwise returns success, and terminates;
Step s2-8:Described JAVA smart card obtains institute according to described reading address from described Application Protocol Data Unit The data of 1 byte stating relative address assembly is as the second correction data;According in the described relative address assembly reading Data, update described second untreatment data length and described reading address;
Step s2-9:Described JAVA smart card updates, according to the described second correction data, the second physics being relocated data Address;The initial value of described the second physical address being relocated data is the method assembly base of described JAVA smart cards for storage Location;
Step s2-10:Described JAVA smart card is according to described the second physical address being relocated data from described JAVA The data of 1 byte is obtained as the index value in constant pool component, execution step S2 in smart cards for storage area.
The length data of the described correction data in described relative address assembly includes the length number of single byte correction data According to the length data with double byte correction data;
Described step S0-1 is specially to step S1:
Step s3-1:Described JAVA smart card obtains institute according to reading address from the Application Protocol Data Unit receiving The length data stating single byte correction data in relative address assembly, as the first untreatment data length, obtains described correlation The length data of the double byte correction data in address components as the second untreatment data length, according to the described length getting The length of degrees of data updates described reading address;The initial value of described reading address is the single byte in described relative address assembly Revise the first address of the length data of data;
Step s3-2:Described JAVA smart card judges whether untreated according to described first untreatment data length Single byte correction data, is then execution step s3-3, otherwise execution step s3-6;
Step s3-3:Described JAVA smart card obtains institute according to described reading address from described Application Protocol Data Unit The data stating 1 byte of relative address assembly revises data as first, according in the described relative address assembly reading Data, update described first untreatment data length and described reading address;
Step s3-4:Described JAVA smart card updates, according to the described first correction data, the first physics being relocated data Address;The initial value of described the first physical address being relocated data is the method assembly base of described JAVA smart cards for storage Location;
Step s3-5:Described JAVA smart card is according to described the first physical address being relocated data from described JAVA intelligence The data of 1 byte can be obtained as the index value in constant pool component, execution step S4 in card memory area;
Step s3-6:Described JAVA smart card judges whether untreated according to described second untreatment data length Double byte correction data, is then execution step s3-7, otherwise returns success, and terminates;
Step s3-7:Described JAVA smart card obtains institute according to described reading address from described Application Protocol Data Unit The data of 1 byte stating relative address assembly is as the second correction data;According in the described relative address assembly reading Data, update described second untreatment data length and described reading address;
Step s3-8:Described JAVA smart card updates, according to the described second correction data, the second physics being relocated data Address;The initial value of described the second physical address being relocated data is the method assembly base of described JAVA smart cards for storage Location;
Step s3-9:Described JAVA smart card is according to described the second physical address being relocated data from described JAVA intelligence The data of 2 bytes can be obtained as the index value in constant pool component, execution step S2 in card memory area.
The length data of the described correction data in described relative address assembly includes the length number of single byte correction data According to the length data with double byte correction data;
Described step S0-1 is specially to step S1:
Step s4-1:Described JAVA smart card obtains institute according to reading address from the Application Protocol Data Unit receiving The length data stating double byte correction data in relative address assembly, as the first untreatment data length, obtains described correlation The length data of the single byte correction data in address components as the second untreatment data length, according to the described length getting The length of degrees of data updates described reading address;The initial value of described reading address is the double byte in described relative address assembly Revise the first address of the length data of data;
Step s4-2:Described JAVA smart card judges whether untreated according to described first untreatment data length Double byte correction data, is then execution step s4-3, otherwise execution step s4-6;
Step s4-3:Described JAVA smart card obtains institute according to described reading address from described Application Protocol Data Unit The data stating 1 byte of relative address assembly revises data as first, according in the described relative address assembly reading Data, update described first untreatment data length and described reading address;
Step s4-4:Described JAVA smart card updates, according to the described first correction data, the first physics being relocated data Address;The initial value of described the first physical address being relocated data is the method assembly base of described JAVA smart cards for storage Location;
Step s4-5:Described JAVA smart card is according to described the first physical address being relocated data from described JAVA intelligence The data of 2 bytes can be obtained as the index value in constant pool component, execution step S4 in card memory area;
Step s4-6:Described JAVA smart card judges whether untreated according to described second untreatment data length Single byte correction data, is then execution step s4-7, otherwise returns success, and terminates;
Step s4-7:Described JAVA smart card obtains institute according to described reading address from described Application Protocol Data Unit The data of 1 byte stating relative address assembly is as the second correction data;According in the described relative address assembly reading Data, update described second untreatment data length and described reading address;
Step s4-8:Described JAVA smart card updates, according to the described second correction data, the second physics being relocated data Address;The initial value of described the second physical address being relocated data is the method assembly base of described JAVA smart cards for storage Location;
Step s4-9:Described JAVA smart card is according to described the second physical address being relocated data from described JAVA intelligence The data of 1 byte can be obtained as the index value in constant pool component, execution step S2 in card memory area.
Include before described step S1:
Step S0-1 ':Described JAVA smart card obtains from the Application Protocol Data Unit receiving according to reading address The length data of the correction data in described relative address assembly as untreatment data length, according to the described length getting The length of data updates described reading address;The initial value of described reading address is the correction data in described relative address assembly Length data first address, execution step S1;
Described step S1 is specially:Described JAVA smart card is according to described reading address from described Application Protocol Data Unit The middle correction data obtaining described relative address assembly, obtains constant according to described correction data from JAVA smart cards for storage area Index value in the assembly of pond, according to the correction data of the described relative address assembly reading, updates described untreatment data long Degree and described reading address;
Include after described step S6:
Step S8:Described JAVA smart card judges whether to have processed all data in described relative address assembly, is then Return success, terminate, otherwise execution step S9;
Step S9:Described JAVA smart card judges the described relative address in this Application Protocol Data Unit receiving Whether the data of assembly is treated to complete, and is to return success, waits and receive the next one and comprise described relative address The Application Protocol Data Unit of the data of assembly, return to step S1, otherwise return to step S1.
If the current corresponding JAVA of item data instructs instructing for first, described step S3 is specially to step S6:
Step A1:Described JAVA smart card judges the reference type of described first instruction, if internal reference then executes step Rapid A2, if external reference then execution step A3;
Step A2:The data of the Part I according to current item data for the described JAVA smart card obtains the first deviant, root Category information assembly initial address according to described first deviant and described JAVA smart cards for storage obtains category information physical address, root Obtain the deviant of category information, execution step A7 according to described category information physical address and EEPROM base address;
Step A3:Described JAVA smart card obtains the data of the Part II of current item data as the category information institute that is cited The bag ID of the bag belonging to;
Step A4:Described JAVA smart card judges that whether described bag ID is less than the first preset value, is then execution step A5, no Then execution step A6;
Step A5:Described JAVA smart card updates the order code of described first instruction, execution step A6;
Step A6:Described JAVA smart card obtains the derivation table address of bag according to described bag ID, according to current item data The derivation table address of the data of Part III and described bag, obtains the deviant of category information, execution step in the derived table of bag A7;
Step A7:Described JAVA smart card using the deviant of described category information as described first parameter, according to described One parameter updates the order parameter of described first instruction.
If the current corresponding JAVA of item data instructs instructing for second, described step S3 is specially to step S6:
Step B1:Described JAVA smart card judges the reference type of described second instruction, if internal reference then executes step Rapid B2, if external reference then execution step B3;
Step B2:The data of the Part I according to current item data for the described JAVA smart card obtains the first deviant, root Category information assembly initial address according to described first deviant and described JAVA smart cards for storage obtains category information physical address, holds Row step B7;
Step B3:Described JAVA smart card obtains the data of the Part II of current item data as the category information institute that is cited The bag ID of the bag belonging to, obtains the derivation table address of bag according to described bag ID;
Step B4:Described JAVA smart card judges that whether described bag ID is less than the first preset value, is then execution step B5, no Then execution step B6;
Step B5:The derived table ground of the data of Part III according to current item data for the described JAVA smart card and described bag Location, obtains the deviant of category information in the derived table of bag, and the deviant according to described category information and ROM base address obtain class letter Breath physical address, execution step B7;
Step B6:The derived table ground of the data of Part III according to current item data for the described JAVA smart card and described bag Location, obtains the deviant of category information in the derived table of bag, and the deviant according to described category information and EEPROM base address obtain Category information physical address, execution step B7;
Step B7:Described JAVA smart card, according to described category information physical address, obtains in described JAVA smart cards for storage area Take current category information;
Step B8:Described JAVA smart card judges whether the data of the Part I of current category information is the second preset value, It is then execution step B9, otherwise execution step B10;
Step B9:The data of Part II according to current category information for the described JAVA smart card and ROM base address, are worked as The physical address of the category information of the parent of front category information, execution step B11;
Step B10:The data of Part II according to current category information for the described JAVA smart card and EEPROM base address, obtain To the physical address of the category information of the parent of current category information, execution step B11;
Step B11:The physical address of the category information of the parent according to described current category information for the described JAVA smart card, in institute State the data of the Part I of the category information of parent obtaining current category information in JAVA smart cards for storage area, according to get The data of the Part IV of data and current item data obtains index value;
Step B12:Described JAVA smart card using described index value as described first parameter, according to described first parameter more The newly order parameter of described second instruction.
If the current corresponding JAVA of item data instructs as the 3rd instruction, described step S3 is specially to step S6:
Step C1:Described JAVA smart card judges the reference type of described 3rd instruction, if internal reference then executes step Rapid C2, if external reference then execution step C3;
Step C2:The data of the Part I according to current item data for the described JAVA smart card obtains the first deviant, root Category information assembly initial address according to described first deviant and described JAVA smart cards for storage obtains category information physical address, holds Row step C7;
Step C3:Described JAVA smart card obtains the data of the Part II of current item data as the category information institute that is cited The bag ID of the bag belonging to, obtains the derivation table address of bag according to described bag ID;
Step C4:Smart card described in described JAVA judges that whether described bag ID is less than the first preset value, is then execution step C5, otherwise execution step C6;
Step C5:The derived table ground of the data of Part III according to current item data for the described JAVA smart card and described bag Location, obtains the deviant of category information in the derived table of bag, and the deviant according to described category information and ROM base address obtain class letter Breath physical address, execution step C7;
Step C6:The derived table ground of the data of Part III according to current item data for the described JAVA smart card and described bag Location, obtains the deviant of category information in the derived table of bag, and the deviant according to described category information and EEPROM base address obtain Category information physical address, execution step C7;
Step C7:JAVA smart card obtains according to the data of described category information physical address and the Part IV of current item data Arrive the physical address of called method, the physical address according to described called method obtains quilt in JAVA smart cards for storage area The number of parameters of call method, the data of the Part IV of the number of parameters according to called method and current item data obtains One parameter, updates the order parameter of described 3rd instruction according to described first parameter.
If the current corresponding JAVA of item data instructs as the 4th instruction, described step S3 is specially to step S6:
Step D1:Described JAVA smart card judges the reference type of described 4th instruction, if internal reference then executes step Rapid D2, if external reference then execution step D3;
Step D2:The data of the Part I according to current item data for the described JAVA smart card obtains the first deviant, root Category information assembly initial address according to described first deviant and described JAVA smart cards for storage obtains category information physical address, holds Row step D7;
Step D3:Described JAVA smart card obtains the data of the Part II of current item data as the category information institute that is cited The bag ID of the bag belonging to, obtains the derivation table address of bag according to described bag ID;
Step D4:Described JAVA smart card judges that whether described bag ID is less than the first preset value, is then execution step D5, no Then execution step D6;
Step D5:The derived table ground of the data of Part III according to current item data for the described JAVA smart card and described bag Location, obtains the deviant of category information in the derived table of bag, and the deviant according to described category information and ROM base address obtain class letter Breath physical address, and update the order code of the 4th instruction, execution step D7;
Step D6:The derived table ground of the data of Part III according to current item data for the described JAVA smart card and described bag Location, obtains the deviant of category information in the derived table of bag, and the deviant according to described category information and EEPROM base address obtain Category information physical address, execution step D7;
Step D7:Described JAVA smart card is according to the number of described category information physical address and the Part IV of current item data According to the offset address obtaining called method, using the offset address of described called method as the first parameter, according to described the One parameter updates the order parameter of described 4th instruction.
If the current corresponding JAVA of item data instructs as the 5th instruction, described step S3 is specially to step S6:
Step E1:Described JAVA smart card judges the reference type of described 5th instruction, if internal reference then executes step Rapid E2, if external reference then execution step E3;
Step E2:The data of the Part V according to current item data for the described JAVA smart card obtains the second deviant, root Static fields assembly initial address according to described second deviant and described JAVA smart cards for storage obtains static fields physical address, root Obtain the offset address of accessed static fields, execution step E4 according to described static fields physical address and EEPROM base address;
Step E3:Described JAVA smart card obtains the data of the Part II of current item data as the category information institute that is cited Belong to bag bag ID, according to described bag ID obtain bag derivation table address, the data of the Part I according to current item data with The derivation table address of described bag, obtains the offset address of accessed static fields, execution step E4 in derived table;
Step E4:Described JAVA smart card is using the offset address of described accessed static fields as described first parameter, root Update the order parameter of described 5th instruction according to described first parameter.
If the current corresponding JAVA of item data instructs as the 6th instruction, described step S3 is specially to step S6:
Step F1:Described JAVA smart card judges the reference type of described 6th instruction, if internal reference then executes step Rapid F2, if external reference then execution step F3;
Step F2:The data of the Part V according to current item data for the described JAVA smart card obtains the second deviant, root Method assembly initial address according to described second deviant and described JAVA smart cards for storage obtains method physical address, according to institute State method physical address and EEPROM base address obtains the deviant of method, execution step F7;
Step F3:Described JAVA smart card obtains the data of the Part II of current item data as belonging to called method Bag bag ID;
Step F4:Described JAVA smart card judges that whether described bag ID is less than the first preset value, is then execution step F5, no Then execution step F6;
Step F5:Described JAVA smart card updates the order code of the 6th instruction, execution step F6;
Step F6:Described JAVA smart card obtains the derivation table address of bag according to described bag ID, according to current item data The derivation table address of the data of Part V and described bag, the deviant of acquisition methods in the derived table of bag;
Step F7:Described JAVA smart card using the deviant of methods described as the first parameter, according to described first parameter Update the order parameter of described 6th instruction.
A kind of device of efficient renewal JAVA instruction, including:First acquisition module, the second acquisition module, first judge mould Block, first processing module, Second processing module, the first update module and output module;
Described first acquisition module, for obtaining the correction data of relative address assembly from Application Protocol Data Unit, Index value in constant pool component is obtained from JAVA smart cards for storage area according to described correction data;
Described second acquisition module, for the rope in the described constant pool component that got according to described first acquisition module Draw value and obtain current item data in described constant pool component, judge whether to get current item data;
Described first judge module, for when described second acquisition module gets current item data, according to currentitem 1st byte of data judges the reference type of current item data corresponding JAVA instruction;
Described first processing module, for judging current item data corresponding JAVA instruction when described first judge module When reference type is internal reference, deviant is obtained according to the first predetermined fraction of current item data, according to described deviant and Described JAVA instructs corresponding assembly initial address and obtains the first parameter;
Described Second processing module, for judging current item data corresponding JAVA instruction when described first judge module When reference type is external reference, obtain the derivation table address wrapping according to the second predetermined fraction of current item data, according to current The table address of deriving of item data and described bag obtains the first parameter in the derived table of bag;
Described first update module, for after described first processing module obtains the first parameter, according to the described first ginseng Number updates the order parameter of described JAVA instruction;After described Second processing module obtains the first parameter, according to the described first ginseng Number updates the order parameter of described JAVA instruction;
Described output module, for when described second acquisition module does not get current item data, returning error message.
Described device also includes:3rd acquisition module and the second judge module;
Described 3rd acquisition module, for according to read address and obtain from the Application Protocol Data Unit receiving The length data of the correction data in relative address assembly as untreatment data length, according to the described length data getting Length update described reading address;The initial value of described reading address is the length of the correction data in described relative address assembly The first address of degrees of data;
Described second judge module, for sentencing according to the described untreatment data length that described 3rd acquisition module gets Break and whether there is untreated correction data;
Described output module, is additionally operable to, when described second judge module judges not existing untreated correction data, return Return successful information;
Described first acquisition module, specifically for obtaining from described Application Protocol Data Unit according to described reading address The correction data of described relative address assembly, obtains constant pool component according to described correction data from JAVA smart cards for storage area In index value, according to the correction data of the described relative address assembly reading, update described untreatment data length and institute State reading address;
Described device also includes the 3rd judge module and receiver module;
Described 3rd judge module, for after described first update module updates the order parameter of described JAVA instruction, Judge whether the data of the described relative address assembly in this Application Protocol Data Unit receiving is treated to complete;
Described output module, is additionally operable to judge this Application Protocol Data Unit receiving when described 3rd judge module In data treated when completing, return success;
Described receiver module, for judging in this Application Protocol Data Unit receiving when described 3rd judge module Data treated when completing, wait and receive the application protocol data of the data that the next one comprises described relative address assembly Unit.
Described 3rd acquisition module includes first acquisition unit and second acquisition unit;
Described first acquisition unit, for according to read address and obtain from the Application Protocol Data Unit receiving The length data of the single byte correction data in relative address assembly as the first untreatment data length, according to the institute getting The length stating length data updates described reading address;The initial value of described reading address is the list in described relative address assembly The first address of the length data of byte correction data;
Described second acquisition unit, for judging not getting the length number of double byte correction data when the 4th judge module According to during as the second untreatment data length, obtained from the described Application Protocol Data Unit receiving according to described reading address The length data of double byte correction data taking described relative address assembly as the second untreatment data length, according to getting Described length data length update described reading address;
Described second judge module includes the first judging unit and the second judging unit;
Described first judging unit, for getting described first untreatment data length when described first acquisition unit Afterwards, untreated single byte correction data is judged whether according to described first untreatment data length;
Described second judging unit, for judging to have got the length of double byte correction data when described 4th judge module When degrees of data gets described second untreatment data length as the second untreatment data length or described second acquisition unit, Untreated double byte correction data is judged whether according to described second untreatment data length;
Described output module, is additionally operable to judge there is not untreated double byte correction data when described second judging unit When, return success;
Described first acquisition module includes the 3rd acquiring unit, the first updating block and the 4th acquiring unit;
Described 3rd acquiring unit, for judging there is untreated single byte correction data when described first judging unit When, the number of 1 byte of described relative address assembly is obtained from described Application Protocol Data Unit according to described reading address According to as the first correction data, according to the data in the described relative address assembly reading, update the described first untreated number According to length and described reading address;
Described first updating block, described first for being got according to described 3rd acquiring unit is revised data and updates It is relocated the first physical address of data;The initial value of described the first physical address being relocated data is described JAVA intelligence The method assembly base address of storage can be blocked;
Described 4th acquiring unit, for according to described first updating block update obtain described in be relocated data First physical address obtains the data of 1 byte as the index in constant pool component from described JAVA smart cards for storage area Value;
Described device includes described 4th judge module, for when described first judging unit judge do not exist untreated During single byte correction data, judge whether that the length data getting double byte correction data is long as the second untreatment data Degree;
Described first acquisition module includes the 5th acquiring unit, the second updating block and the 6th acquiring unit;
Described 5th acquiring unit, for judging there is untreated double byte correction data when described second judging unit When, the number of 1 byte of described relative address assembly is obtained from described Application Protocol Data Unit according to described reading address According to as the second correction data, according to the data in the described relative address assembly reading, update the described second untreated number According to length and described reading address;
Described second updating block, described second for being got according to described 5th acquiring unit is revised data and updates It is relocated the second physical address of data;The initial value of described the second physical address being relocated data is described JAVA intelligence The method assembly base address of storage can be blocked;
Described 6th acquiring unit, for according to described second updating block update obtain described in be relocated data Second physical address obtains the data of 2 bytes as the index in constant pool component from described JAVA smart cards for storage area Value.
Described 3rd acquisition module includes the 7th acquiring unit and the 8th acquiring unit;
Described 7th acquiring unit, for according to read address and obtain from the Application Protocol Data Unit receiving The length data of the double byte correction data in relative address assembly as the first untreatment data length, according to the institute getting The length stating length data updates described reading address;The initial value of described reading address is double in described relative address assembly The first address of the length data of byte correction data;
Described 8th acquiring unit, for judging not getting the length number of single byte correction data when the 5th judge module According to during as the second untreatment data length, obtained from the described Application Protocol Data Unit receiving according to described reading address The length data of single byte correction data taking described relative address assembly as the second untreatment data length, according to getting Described length data length update described reading address;
Described second judge module includes the 3rd judging unit and the 4th judging unit;
Described 3rd judging unit, for getting described first untreatment data length when described 7th acquiring unit Afterwards, untreated double byte correction data is judged whether according to described first untreatment data length;
Described 4th judging unit, for judging to have got the length of single byte correction data when described 5th judge module When degrees of data gets described second untreatment data length as the second untreatment data length or described 8th acquiring unit, Untreated single byte correction data is judged whether according to described second untreatment data length;
Described output module, is additionally operable to judge there is not untreated single byte correction data when described 4th judging unit When, return success;
Described first acquisition module includes the 9th acquiring unit, the 3rd updating block and the tenth acquiring unit;
Described 9th acquiring unit, for judging there is untreated double byte correction data when described 3rd judging unit When, the number of 1 byte of described relative address assembly is obtained from described Application Protocol Data Unit according to described reading address According to as the first correction data, according to the data in the described relative address assembly reading, update the described first untreated number According to length and described reading address;
Described 3rd updating block, described first for being got according to described 9th acquiring unit is revised data and updates It is relocated the first physical address of data;The initial value of described the first physical address being relocated data is described JAVA intelligence The method assembly base address of storage can be blocked;
Described tenth acquiring unit, for according to described 3rd updating block update obtain described in be relocated data First physical address obtains the data of 2 bytes as the index in constant pool component from described JAVA smart cards for storage area Value;
Described device includes described 5th judge module, for when described 3rd judging unit judge do not exist untreated During double byte correction data, judge whether that the length data getting single byte correction data is long as the second untreatment data Degree;
Described first acquisition module includes the 11st acquiring unit, the 4th updating block and the 12nd acquiring unit;
Described 11st acquiring unit, for judging there is untreated single byte correction number when described 4th judging unit According to when, obtain 1 byte of described relative address assembly from described Application Protocol Data Unit according to described reading address Data, as the second correction data, according to the data in the described relative address assembly reading, updates described second untreated Data length and described reading address;
Described 4th updating block, described second for being got according to described 11st acquiring unit revises data more Newly it is relocated the second physical address of data;The initial value of described the second physical address being relocated data is described JAVA The method assembly base address of smart cards for storage;
Described 12nd acquiring unit, for according to described 4th updating block update obtain described in be relocated data The second physical address obtain the data of 1 byte from described JAVA smart cards for storage area as the index in constant pool component Value.
Described 3rd acquisition module is specifically for obtaining from the Application Protocol Data Unit receiving according to reading address The length data of the single byte correction data in described relative address assembly, as the first untreatment data length, obtains described phase Close address components in double byte correction data length data as the second untreatment data length, according to get The length of length data updates described reading address;The initial value of described reading address is the individual character in described relative address assembly Section revises the first address of the length data of data;
Described second judge module includes the 5th judging unit and the 6th judging unit;
Described 5th judging unit, for getting described first untreatment data length when described 3rd acquisition module Afterwards, untreated single byte correction data is judged whether according to described first untreatment data length;
Described 6th judging unit, for judging there is not untreated single byte correction number when described 5th judging unit According to when, judged whether untreated double according to the described second untreatment data length that described 3rd acquisition module gets Byte correction data;
Described output module, is additionally operable to judge there is not untreated double byte correction data when described 6th judging unit When, return success;
Described first acquisition module includes the 13rd acquiring unit, the 5th updating block and the 14th acquiring unit;
Described 13rd acquiring unit, for judging there is untreated single byte correction number when described 5th judging unit According to when, obtain 1 byte of described relative address assembly from described Application Protocol Data Unit according to described reading address Data, as the first correction data, according to the data in the described relative address assembly reading, updates described first untreated Data length and described reading address;
Described 5th updating block, described first for being got according to described 13rd acquiring unit revises data more Newly it is relocated the first physical address of data;The initial value of described the first physical address being relocated data is described JAVA The method assembly base address of smart cards for storage;
Described 14th acquiring unit, for according to described 5th updating block update obtain described in be relocated data The first physical address obtain the data of 1 byte from described JAVA smart cards for storage area as the index in constant pool component Value;
Described first acquisition module includes the 15th acquiring unit, the 6th updating block and the 16th acquiring unit;
Described 15th acquiring unit, for judging there is untreated double byte correction number when described 6th judging unit According to when, obtain 1 byte of described relative address assembly from described Application Protocol Data Unit according to described reading address Data, as the second correction data, according to the data in the described relative address assembly reading, updates described second untreated Data length and described reading address;
Described 6th updating block, described second for being got according to described 15th acquiring unit revises data more Newly it is relocated the second physical address of data;The initial value of described the second physical address being relocated data is described JAVA The method assembly base address of smart cards for storage;
Described 16th acquiring unit, for according to described 6th updating block update obtain described in be relocated data The second physical address obtain the data of 2 bytes from described JAVA smart cards for storage area as the index in constant pool component Value.
Described 3rd acquisition module is specifically for obtaining from the Application Protocol Data Unit receiving according to reading address The length data of the double byte correction data in described relative address assembly, as the first untreatment data length, obtains described phase Close address components in single byte correction data length data as the second untreatment data length, according to get The length of length data updates described reading address;The initial value of described reading address is the double word in described relative address assembly Section revises the first address of the length data of data;
Described second judge module includes the 7th judging unit and the 8th judging unit;
Described 7th judging unit, for getting described first untreatment data length when described 3rd acquisition module Afterwards, untreated double byte correction data is judged whether according to described first untreatment data length;
Described 8th judging unit, for judging there is not untreated double byte correction number when described 7th judging unit According to when, untreated list is judged whether according to the described second untreatment data length that described 3rd acquisition module gets Byte correction data;
Described output module, is additionally operable to judge there is not untreated single byte correction data when described 8th judging unit When, return success;
Described first acquisition module includes the 17th acquiring unit, the 7th updating block and the 18th acquiring unit;
Described 17th acquiring unit, for judging there is untreated double byte correction number when described 7th judging unit According to when, obtain 1 byte of described relative address assembly from described Application Protocol Data Unit according to described reading address Data, as the first correction data, according to the data in the described relative address assembly reading, updates described first untreated Data length and described reading address;
Described 7th updating block, described first for being got according to described 17th acquiring unit revises data more Newly it is relocated the first physical address of data;The initial value of described the first physical address being relocated data is described JAVA The method assembly base address of smart cards for storage;
Described 18th acquiring unit, for according to described 7th updating block update obtain described in be relocated data The first physical address obtain the data of 2 bytes from described JAVA smart cards for storage area as the index in constant pool component Value;
Described first acquisition module includes the 19th acquiring unit, the 8th updating block and the 20th acquiring unit;
Described 19th acquiring unit, for judging there is untreated single byte correction number when described 8th judging unit According to when, obtain 1 byte of described relative address assembly from described Application Protocol Data Unit according to described reading address Data, as the second correction data, according to the data in the described relative address assembly reading, updates described second untreated Data length and described reading address;
Described 8th updating block, described second for being got according to described 19th acquiring unit revises data more Newly it is relocated the second physical address of data;The initial value of described the second physical address being relocated data is described JAVA The method assembly base address of smart cards for storage;
Described 20th acquiring unit, for according to described 8th updating block update obtain described in be relocated data The second physical address obtain the data of 1 byte from described JAVA smart cards for storage area as the index in constant pool component Value.
Described device includes the 4th acquisition module, the 6th judge module, the 7th judge module and receiver module;
Described 4th acquisition module, for according to read address and obtain from the Application Protocol Data Unit receiving The length data of the correction data in relative address assembly as untreatment data length, according to the described length data getting Length update described reading address;The initial value of described reading address is the length of the correction data in described relative address assembly The first address of degrees of data;
Described first acquisition module, specifically for obtaining from described Application Protocol Data Unit according to described reading address The correction data of described relative address assembly, obtains constant pool component according to described correction data from JAVA smart cards for storage area In index value, according to the correction data of the described relative address assembly reading, update described untreatment data length and institute State reading address;
Described 6th judge module, for after described first update module updates the order parameter of described JAVA instruction, Judge whether to have processed all data in described relative address assembly;
Described output module, is additionally operable to judge in processed described relative address assembly when described 6th judge module After all data, return success;
Described 7th judge module, for judging in untreated complete described relative address assembly when described 6th judge module All data after, whether judge the data of described relative address assembly in this Application Protocol Data Unit receiving Treated complete;
Described output module, is additionally operable to judge in this Application Protocol Data Unit receiving when the 7th judge module After the completion of data is treated, return success;
Described receiver module, for judging the number in this Application Protocol Data Unit receiving when the 7th judge module After the completion of treated, wait and receive the application protocol data list of the data that the next one comprises described relative address assembly Unit.
If the current corresponding JAVA of item data instructs instructing for first, described first judge module, specifically for judging State the reference type of the first instruction;
Described first processing module, specifically for judging the reference type of described first instruction when described first judge module For, during internal reference, the data of the Part I according to current item data obtains the first deviant, according to described first deviant Obtain category information physical address with the category information assembly initial address of described JAVA smart cards for storage, according to described category information physics Address and EEPROM base address obtain the deviant of category information;
Described Second processing module includes the 21st acquiring unit, the 9th judging unit, the 9th updating block and second 12 acquiring units;
Described 21st acquiring unit, for judging the reference type of described first instruction when described first judge module During for external reference, obtain current item data Part II data as the bag being cited belonging to category information bag ID;
Described 9th judging unit, for judging whether the described bag ID that described 21st acquiring unit gets is less than First preset value;
Described 9th updating block, for when described 9th judging unit judge described bag ID be less than the first preset value when, Update the order code of the first instruction;
When described 9th judging unit, described 22nd acquiring unit, for judging that described bag ID is not less than first and presets After the order code of value or described 9th updating block renewal the first instruction, obtain the derivation table address of bag, root according to described bag ID According to the data of the Part III of current item data and the derivation table address of bag, the derived table of bag obtains the skew of category information Value;
Described first update module, specifically for after described first processing module obtains described deviant, by category information Deviant as described first parameter, update the order parameter of described first instruction according to described first parameter;When described After 22 acquiring units get described deviant, using the deviant of category information as described first parameter, according to described One parameter updates the order parameter of described first instruction.
If the current corresponding JAVA of item data instructs instructing for second, described first judge module, specifically for judging State the reference type of the second instruction;
Described first processing module, specifically for judging the reference type of described second instruction when described first judge module For, during internal reference, the data of the Part I according to current item data obtains the first deviant, according to described first deviant Obtain category information physical address with the category information assembly initial address of described JAVA smart cards for storage, according to described category information physics Address and EEPROM base address obtain the deviant of category information;
Described Second processing module includes the 23rd acquiring unit, the tenth judging unit, first processing units and second Processing unit;
Described 23rd acquiring unit, for judging the reference type of described second instruction when described first judge module During for external reference, obtain current item data Part II data as the bag being cited belonging to category information bag ID, root Obtain the derivation table address of bag according to described bag ID;
Described tenth judging unit, for judging whether the described bag ID that described 23rd acquiring unit gets is less than First preset value;
Described first processing units, for when described tenth judging unit judge described bag ID be less than the first preset value when, The derivation table address of the data of the Part III according to current item data and described bag, obtains category information in the derived table of bag Deviant, the deviant according to described category information and ROM base address obtain category information physical address;
When described tenth judging unit, described second processing unit, for judging that described bag ID is not less than the first preset value When, the derivation table address of the data of the Part III according to current item data and described bag, the derived table of bag obtains class letter The deviant of breath, the deviant according to described category information and EEPROM base address obtain category information physical address;
Described first update module include the 24th acquiring unit, the 11st judging unit, the 3rd processing unit, the 4th Processing unit, the 5th processing unit and the tenth updating block;
Described 24th acquiring unit is for obtaining category information physical address when described first processing module or described After first processing units obtain category information physical address, or described second processing unit obtains category information physical address, according to institute State category information physical address, obtain current category information in JAVA smart cards for storage area;
Described 11st judging unit, for judging the of current category information that described 24th acquiring unit gets Whether the data of a part is the second preset value;
Described 3rd processing unit, for judging the number of the Part I of current category information when described 11st judging unit According to during for the second preset value, the data of the Part II according to current category information and ROM base address, obtain the father of current category information The physical address of the category information of class;
Described fourth processing unit, for judging the number of the Part I of current category information when described 11st judging unit During according to being not the second preset value, the data of the Part II according to current category information and EEPROM base address, obtain current class letter The physical address of the category information of parent of breath;
Described 5th processing unit, for obtaining current class letter when described 3rd processing unit or described fourth processing unit After the physical address of the category information of parent of breath, the physical address of the category information of the parent according to current category information, described The data of the Part I of the category information of parent of current category information is obtained, according to the number getting in JAVA smart cards for storage area Obtain index value according to the data with the Part IV of current item data;
Described tenth updating block, for after described 5th processing unit obtains described index value, by described index value As described first parameter, update the order parameter of described second instruction according to described first parameter.
If the current corresponding JAVA of item data instructs as the 3rd instruction, described first judge module, specifically for judging State the reference type of the 3rd instruction;
Described first processing module, specifically for judging the reference type of described 3rd instruction when described first judge module For, during internal reference, the data of the Part I according to current item data obtains the first deviant, according to described first deviant Obtain category information physical address with the category information assembly initial address of described JAVA smart cards for storage;
Described Second processing module includes the 25th acquiring unit, the 12nd judging unit, the 6th processing unit and Seven processing units;
Described 25th acquiring unit, for judging the reference type of described 3rd instruction when described first judge module During for external reference, obtain current item data Part II data as the bag being cited belonging to category information bag ID, root Obtain the derivation table address of bag according to described bag ID;
Whether described 12nd judging unit is little for judging the described bag ID that described 25th acquiring unit gets In the first preset value;
When described 12nd judging unit, described 6th processing unit, for judging that described bag ID is less than the first preset value When, the derivation table address of the data of the Part III according to current item data and described bag, the derived table of bag obtains class letter The deviant of breath, the deviant according to described category information and ROM base address obtain category information physical address;
When described 12nd judging unit, described 7th processing unit, for judging that described bag ID is not less than the first preset value When, the derivation table address of the data of the Part III according to current item data and described bag, the derived table of bag obtains class letter The deviant of breath, the deviant according to described category information and EEPROM base address obtain category information physical address;
Described first update module, specifically for obtaining described category information physical address when described first processing module, or Described 6th processing unit gets described category information physical address, or described 7th processing unit gets described category information thing The thing of called method behind reason address, is obtained according to the data of described category information physical address and the Part IV of current item data Reason address, the physical address according to described called method obtains the parameter of called method in JAVA smart cards for storage area Number, the data of the 4th byte of the number of parameters according to called method and current item data obtains the first parameter, according to described First parameter updates the order parameter of described 3rd instruction.
If the current corresponding JAVA of item data instructs as the 4th instruction, described first judge module, specifically for judging State the reference type of the 4th instruction;
Described first processing module, specifically for judging the reference type of described 4th instruction when described first judge module For, during internal reference, the data of the Part I according to current item data obtains the first deviant, according to described first deviant Obtain category information physical address with the category information assembly initial address of described JAVA smart cards for storage;
Described Second processing module includes the 26th acquiring unit, the 13rd judging unit, the 8th processing unit and Nine processing units;
Described 26th acquiring unit, for judging the reference type of described 4th instruction when described first judge module During for external reference, obtain current item data Part II data as the bag being cited belonging to category information bag ID, root Obtain the derivation table address of bag according to described bag ID;
Whether described 13rd judging unit is little for judging the described bag ID that described 26th acquiring unit gets In the first preset value;
When described 13rd judging unit, described 8th processing unit, for judging that described bag ID is less than the first preset value When, the derivation table address of the data of the Part III according to current item data and described bag, the derived table of bag obtains class letter The deviant of breath, the deviant according to described category information and ROM base address obtain category information physical address, and update the 4th instruction Order code;
When described 13rd judging unit, described 9th processing unit, for judging that described bag ID is not less than the first preset value When, the derivation table address of the data of the Part III according to current item data and described bag, the derived table of bag obtains class letter The deviant of breath, the deviant according to described category information and EEPROM base address obtain category information physical address;
Described first update module, specifically for obtaining described category information physical address when described first processing module, or Described 8th processing unit gets described category information physical address, or described 9th processing unit gets described category information thing Behind reason address, the inclined of called method is obtained according to the data of described category information physical address and the Part IV of current item data Move address, using the offset address of described called method as the first parameter, described 4th finger is updated according to described first parameter The order parameter of order.
If the current corresponding JAVA of item data instructs as the 5th instruction, described first judge module, specifically for judging State the reference type of the 5th instruction;
Described first processing module, specifically for judging the reference type of described 5th instruction when described first judge module For, during internal reference, the data of the Part V according to current item data obtains the second deviant, according to described second deviant Obtain static fields physical address with the static fields assembly initial address of described JAVA smart cards for storage, according to described static fields physics Address and EEPROM base address obtain being accessed the offset address of static fields;
Described Second processing module, specifically for judging the reference type of described 5th instruction when described first judge module During for external reference, obtain current item data Part II data as the bag being cited belonging to category information bag ID, root Obtain the derivation table address of bag, the derived table ground of the data of the Part I according to current item data and described bag according to described bag ID Location, obtains the offset address of accessed static fields in derived table;
Described first update module, specifically for obtaining the skew of described accessed static fields when described first processing module Address, or after described Second processing module obtains the offset address of described accessed static fields, by described accessed static fields Offset address, as described first parameter, updates the order parameter of described 5th instruction according to described first parameter.
If the current corresponding JAVA of item data instructs as the 6th instruction, described first judge module, specifically for judging State the reference type of the 6th instruction;
Described first processing module, specifically for judging the reference type of described 6th instruction when described first judge module For, during internal reference, the data of the Part V according to current item data obtains the second deviant, according to described second deviant Obtain method physical address with the method assembly initial address of described JAVA smart cards for storage, according to methods described physical address and EEPROM base address obtains the deviant of method;
Described Second processing module include the 27th acquiring unit, the 14th judging unit, the 11st updating block and 28th acquiring unit;
Described 27th acquiring unit, for judging the reference type of described 6th instruction when described first judge module During for external reference, obtain current item data Part II data as the bag belonging to called method bag ID;
Whether described 14th judging unit is little for judging the described bag ID that described 27th acquiring unit gets In the first preset value;
When described 14th judging unit, described 11st updating block, for judging that described bag ID is pre- less than described first If during value, update the order code of described 6th instruction;
When described 13rd judging unit, described 28th acquiring unit, for judging that described bag ID is not less than described the After one preset value, or the order code of described 11st updating block renewal the 6th instruction, obtain the derivation of bag according to described bag ID Table address, the derivation table address of the data of the Part V according to current item data and described bag, obtain in the derived table of bag The deviant of method;
Described first update module, specifically for obtaining the deviant of methods described when described first processing module, or institute State after the 28th acquiring unit gets the deviant of methods described, using the deviant of methods described as the first parameter, root Update the order parameter of described 6th instruction according to described first parameter.
The present invention compared with prior art, has advantages below:
The method that the present invention provides is according to quoting the physical address calculating quantity to be quoted evidence and partially outside JAVA intelligent card Move address, directly cover the offset address of quantity to be quoted evidence in instruction and be relocated place accordingly, simplify JAVA intelligence It is stuck in the handling process in the downloading process of CAP file.
Brief description
Fig. 1 is the flow chart of the method for a kind of efficient renewal JAVA instruction that the embodiment of the present invention 1 provides;
Fig. 2 is the flow chart of the method for a kind of efficient renewal JAVA instruction that the embodiment of the present invention 2 provides;
Fig. 3 is the flow chart of the method that the first instruction is carried out with reorientation that the embodiment of the present invention 2 provides;
Fig. 4 is the flow chart of the method that the second instruction is carried out with reorientation that the embodiment of the present invention 2 provides;
Fig. 5 is the flow chart of the method that the 3rd instruction is carried out with reorientation that the embodiment of the present invention 2 provides;
Fig. 6 is the flow chart of the method that the 4th instruction is carried out with reorientation that the embodiment of the present invention 2 provides;
Fig. 7 is the flow chart of the method that the 5th instruction is carried out with reorientation that the embodiment of the present invention 2 provides;
Fig. 8 is the flow chart of the method that the 6th instruction is carried out with reorientation that the embodiment of the present invention 2 provides;
Fig. 9 is the module map of the device of a kind of efficient renewal JAVA instruction that the embodiment of the present invention 3 provides.
Specific embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete Site preparation description is it is clear that described embodiment is only a part of embodiment of the present invention, rather than whole embodiments.It is based on Embodiment in the present invention, it is every other that those of ordinary skill in the art are obtained under the premise of not making creative work Embodiment, broadly falls into the scope of protection of the invention.
The executable file of JAVA smart card(CAP file)It is to compile multiple application programs(Applet)Generation result, Contain all classes defined in a bag and interface, be one-to-one relation and bag between.During actual hair fastener operation, first Need in this loading of executed file to JAVA smart card, and the application example of needs is installed;User is using the application installed Example executes operating function.All employ executable file in the above-mentioned two operational phase(CAP file)The content being provided. CAP file comprises 12 assemblies, and the label value of assembly is respectively from 1 to 12:Head assembly(COMPONENT_Header), directory group Part(COMPONENT_Directory), application component(COMPONENT_Applet), input module(COMPONENT_ Import), constant pool component(COMPONENT_ConstantPool), category information assembly(COMPONENT_Class), method group Part(COMPONENT_Method), static fields assembly(COMPONENT_StaticField), relative address assembly (COMPONENT_ReferenceLocation), output precision(COMPONENT_Export), descriptor assembly (COMPONENT_Descriptor)With debugging assembly(COMPONENT_Debug), a complete CAP file, except application journey Sequence assembly(COMPONENT_Applet), output precision(COMPONENT_Export)With debugging assembly(COMPONENT_ Debug)It is optional outer, other are essential.Each assembly is sent in order as the data in Application Protocol Data Unit To in JAVA smart card;If the length of the data of an assembly exceedes the length of the transmission data that Application Protocol Data Unit specifies Degree, then this assembly is sent to JAVA smart card by subpackage by multiple Application Protocol Data Units;If the data of an assembly Length is not up to the length of the transmission data that Application Protocol Data Unit specifies, then continue transmission in this Application Protocol Data Unit The data of next assembly, i.e. may only comprise an assembly in the Application Protocol Data Unit that JAVA smart card receives Data is it is also possible to comprise the data of multiple assemblies.Finally 4 assemblies are only remained on JAVA smart card:Method assembly (COMPONENT_Method), category information assembly(COMPONENT_Class), static fields assembly(COMPONENT_ StaticField)And output precision(COMPONENT_Export), remaining assembly be install when extract useful information and not JAVA smart card preserves.
In 12 assemblies of CAP file, category information assembly(COMPONENT_Class)Preserve application declarative all classes and The information of interface;Method assembly(COMPONENT_Method)Preserve all methods and the interface of application declarative, and utilize 2 bytes Index referenced classes, method and domain;Constant pool component(COMPONENT_ConstantPool)Store method assembly(COMPONENT_ Method)All classes, method and the domain information quoted, is divided into class, example domains, empty method, paternal method, static fields and static method 6 classes, every group information is 4 bytes;Relative address assembly(COMPONENT_ReferenceLocation)Store method assembly (COMPONENT_Method)The skew of middle index.
In the downloading process of CAP file, a part of assembly is parsed, simultaneously to relatively by JAVA intelligence calorie requirement Location assembly(COMPONENT_ReferenceLocation)In the position specified linked, method assembly can be linked to (COMPONENT_Method)One of call number, and according to call number search constant pool component(COMPONENT_ ConstantPool)The class corresponding with this call number of middle preservation, the method or domain actual address in EEPROM, call reality The data of storage in the address of border;That is, calling of method needs two steps to realize in fact:
1. according to relative address assembly(COMPONENT_ReferenceLocation)In the position specified linked, Acquisition methods assembly(COMPONENT_Method)In call number;
2. constant pool component is searched according to call number(COMPONENT_ConstantPool)Middle preservation and this call number Corresponding class, the method or domain actual address in EEPROM, calls the data of storage in actual address.
Embodiment 1
Embodiments of the invention 1 provide a kind of method of efficient renewal JAVA instruction, as shown in figure 1, the method includes:
Step S1:JAVA smart card obtains the correction data of relative address assembly from Application Protocol Data Unit, according to Revise data and obtain the index value in constant pool component from JAVA smart cards for storage area;
Step S2:JAVA smart card obtains in constant pool component according to the index value in the constant pool component getting works as Front item data, judges whether to get current item data, is then execution step S3, otherwise return error message, terminates;
Step S3:According to the 1st byte of current item data, JAVA smart card judges that the corresponding JAVA of current item data refers to The reference type of order, if internal reference then execution step S4, if external reference then execution step S5;
Step S4:JAVA smart card obtains deviant according to the first predetermined fraction of current item data, according to deviant and JAVA instructs corresponding assembly initial address and obtains the first parameter, execution step S6;
Step S5:JAVA smart card obtains the derivation table address wrapping according to the second predetermined fraction of current item data, according to The table address of deriving of current item data and bag obtains the first parameter, execution step S6 in the derived table of bag;
Step S6:JAVA smart card updates the order parameter of JAVA instruction according to the first parameter, terminates.
Embodiment 2
Embodiments of the invention 2 provide a kind of method of efficient renewal JAVA instruction, as shown in Fig. 2 the method includes:
When the label value of assembly in the Application Protocol Data Unit that JAVA smart card receives is 9, execute following steps:
Step 101:JAVA smart card obtains the length of relative address assembly from Application Protocol Data Unit, according to reading Address obtains the length data of the single byte correction data of relative address assembly as first not from Application Protocol Data Unit Processing data length, according to the length of the length data getting, updates the length reading address and reduced data;
Specifically, JAVA smart card obtains the number of 2 bytes after the label value of assembly in Application Protocol Data Unit According to the length as relative address assembly;Read the length for the single byte correction data of relative address assembly for the initial value of address The first address of data, the length data of single byte correction data is 2 bytes, afterwards for single byte correction data;Processed number According to length initial value be 0;Updating reading address is will to read address from Jia 2, and the length updating reduced data is to have been located The length of reason data Jia 3 certainly;
For example, Application Protocol Data Unit is:
0x090x000x66
0x000x30
0x120x040x390x2D0x2B0x0D0x700x0C0x020x070x220x040x100x050x020x090x030x1C0x020 x0E0x040x100x050x020x0B0x190x1A0x060x060x040x150x020x110x040x110x020x120x040x 0A0x050x020x0A0x0A0x110x050x060x110x07
0x000x32
0x070x060x0B0x040x060x070x110x120x050x080x090x170x2B0x170x160x150x060x030x080 x080x080x080x060x030x150x290x0E0x180x3B0x180x0A0x030x0E0x0C0x0A0x1C0x0D0x0B0x 070x0E0x3A0x090x0A0x030x1F0x030x120x030x100x05
Wherein, 0x09 is the label value of assembly, and 0x0066 is the length of relative address assembly, 0x0030 single byte correction number According to length data;
Step 102:According to the first untreatment data length, JAVA smart card judges whether that untreated single byte is repaiied Correction data, is then execution step 103, otherwise execution step 106;
Step 103:JAVA smart card obtains the 1 of relative address assembly according to reading address from Application Protocol Data Unit The data of individual byte, as the first correction data, according to the data of the relative address assembly reading, updates the first untreated number Length according to length, reading address and reduced data;
Specifically, updating reading address is will to read address from Jia 1, and updating the first untreatment data length is by first not From subtracting 1, the length updating reduced data is certainly Jia 1 by the length of reduced data to processing data length;
Step 104:JAVA smart card updates, according to the first correction data, the first physical address being relocated data;
Specifically, the initial value being relocated the first physical address of data is the method assembly base of JAVA smart cards for storage Address;Update the first physical address being relocated data, specially:The first physical address being relocated data is added the One revises the first physical address being relocated data after data is updated;The first thing being relocated data after renewal Reason address is the physical address being relocated data in method assembly;
For example, the initial value being relocated the first physical address of data is method assembly base address, i.e. 0x10000, if First revises data for 0x12, then the first physical address being relocated data after updating is 0x10000+0x12= 0x10012;If the first physical address being relocated data is 0x10012, first revises the quilt for 0x04, then after updating for the data First physical address of reorientation data is 0x10012+0x04=0x10016;If the first physical address being relocated data is 0x10016, first revises data for 0x039, then the first physical address being relocated data after updating is 0x10016+ 0x39=0x1004F;
Step 105:JAVA smart card is according to being relocated the first physical address of data from JAVA smart cards for storage area The data obtaining 1 byte is as the index value in constant pool component, execution step 111;
For example, method assembly base address is 0x10000, and method assembly is as follows:
0x010x020xDF0x800x080x020xE90x000x180x020x400x180x8C0x000x110x18
0x030x890x000x180x010x870x010x8F0x000x130x3D0x8C0x000x140x930x05
0x300x8F0x000x170x3D0x180x1D0x1E0x8C0x000x060x3B0x7A0x000x200x7A
0x010x200x040x780x050x240x030x310x190x8B0x000x070x2E0x1B0x030x25
0x610x270x1B0x040x250x100xA40x6B0x200x180x190x8B0x000x080x890x00
0x8D0x000x090x1B0x080x1B0x070x250x8B0x000x0A0x990x000xB60x110x69
0x990x8D0x000x0B0xA80x000xAD0x1B0x030x250x060x530x06*0x6E0x130x1B……
If the first physical address being relocated data is 0x10012, the data of 1 getting byte, i.e. constant Index value in the assembly of pond is 0x00;If the first physical address being relocated data is 0x10016,1 getting word The data of section, that is, the index value in constant pool component is 0x01;If the first physical address being relocated data is 0x1004F, The data of 1 byte then getting, that is, the index value in constant pool component is 0x00;
Step 106:JAVA smart card judges whether to obtain the double of relative address assembly from Application Protocol Data Unit The length data of byte correction data, as the second untreatment data length, is then execution step 107, otherwise JAVA smart card root The length of the double byte correction data of relative address assembly is obtained according to reading address from the Application Protocol Data Unit receiving As the second untreatment data length, the length according to the length data getting updates and reads address and reduced data data Length, execution step 107;
Specifically, updating reading address is will to read address from Jia 2, and the length updating reduced data is by processed number According to length from Jia 2;
Specifically, the data of front 2 bytes of double byte correction data is the length data of double byte correction data, afterwards Content for double byte correction data;For example, the length data of double byte correction data is 0x0032;
Step 107:According to the second untreatment data length, JAVA smart card judges whether that untreated double byte is repaiied Correction data, is then execution step 108, otherwise returns success, and terminates;
Step 108:JAVA smart card obtains the 1 of relative address assembly according to reading address from Application Protocol Data Unit The data of individual byte, as the second correction data, according to the data of the relative address assembly reading, updates the second untreated number Length according to length, reading address and reduced data;
Specifically, updating reading address is will to read address from Jia 1, and updating the second untreatment data length is by second not From subtracting 1, the length updating reduced data is certainly Jia 1 by the length of reduced data to processing data length;
Step 109:JAVA smart card updates, according to the second correction data, the second physical address being relocated data;
Specifically, the initial value being relocated the second physical address of data is the method assembly base of JAVA smart cards for storage Address;Update the second physical address being relocated data, specially:The second physical address being relocated data is added the Two revise the second physical address being relocated data after data are updated;The second thing being relocated data after renewal Reason address is the physical address being relocated data in method assembly;
For example, the initial value being relocated the second physical address of data is method assembly base address, i.e. 0x10000, if Second revises data for 0x07, then the second physical address being relocated data after updating is 0x10000+0x12= 0x10007;If the second physical address being relocated data is 0x10007, second revises the quilt for 0x06, then after updating for the data Second physical address of reorientation data is 0x10012+0x04=0x1000D;If the second physical address being relocated data is 0x1000D, second revises data for 0x0B, then the second physical address being relocated data after updating is 0x10016+0x39 =0x10018;
Step 110:JAVA smart card is according to being relocated the second physical address of data from JAVA smart cards for storage area The data obtaining 2 bytes is as the index value in constant pool component, execution step 111;
For example, if the second physical address being relocated data is 0x10007, the data of 2 getting byte, that is, Index value in constant pool component is 0x0018;If the second physical address being relocated data is 0x1000D, get The data of 2 bytes, that is, the index value in constant pool component is 0x0011;If the second physical address being relocated data is 0x10018, then the data of 2 getting byte, that is, the index value in constant pool component is 0x0013;
Step 111:JAVA smart card obtains in constant pool component according to the index value in the constant pool component getting One item data, judges whether to get data according to index value, is, using the data getting as current item data, executes Step 112, otherwise returns error message, terminates;
Specifically, in constant pool component, an item data is the data that size is 4 bytes;
For example, constant pool component
0x000x1B
0x020x000x000x060x020x000x000x010x020x000x000x04
0x020x000x000x000x020x000x000x050x020x000x000x03
0x060x000x000x090x030x800x0A0x010x030x800x0A0x06
0x060x800x080x030x030x800x060x020x060x800x070x01
0x060x000x020xD30x030x800x0A0x080x060x800x100x05
0x060x000x010xDF0x060x000x010x1B0x060x800x030x00
0x030x000x000x0A0x010x810x030x000x060x810x030x00
0x060x000x020xC70x030x000x000x0B0x010x000x000x00
0x010x810x010x000x060x800x080x110x060x800x080x12
Wherein, 0x001B is the number of data item in constant pool component, and every 4 bytes are an item data afterwards;
If the index value in constant pool component is 0x00, current item data is 0x02000006;If in constant pool component Index value be 0x01, then current item data is 0x02000001;If the index value in constant pool component is 0x0018, currently Item data is 0x01810100;If the index value in constant pool component is 0x0011, current item data is 0x06800300;If Index value in constant pool component is 0x0013, then current item data is 0x01810300;
Step 112:JAVA smart card judges the value of the 1st byte of current item data, if 1 is carried out to the first instruction Reorientation, execution step 113;If 2 carry out reorientation, execution step 113 to the second instruction;If 3 instruct to the 3rd Carry out reorientation, execution step 113;If 4 carry out reorientation, execution step 113 to the 4th instruction;If 5 to the 5th Instruction carries out reorientation, execution step 113;If 6 carry out reorientation, execution step 113 to the 6th instruction;
Specifically, first instruct as new instruction, newarray instruction, instanceof instruction and chackcast instruction; Second instructs as getfield instruction and putfield instruction;3rd instructs as invokevirtual instruction;4th instructs and is Invokespecial instructs;5th instructs as putstatic instruction and getstatic instruction;6th instructs and is Invokestatic instructs;
Step 113:JAVA smart card judges whether to locate according to the length of reduced data and the length of relative address assembly Manage all data in relative address assembly, be to return success, terminated, otherwise execution step 114;
Specifically, JAVA smart card judges whether the length of reduced data is equal to the length of the relative address assembly getting Degree, is then to determine all data having processed in relative address assembly, otherwise determines the institute in untreated complete relative address assembly There is data;
Step 114:JAVA smart card judges the relative address assembly in this Application Protocol Data Unit receiving Whether data is treated to complete, and is to return success, execution step 115, otherwise return to step 102;
Step 115:JAVA smart card waits and receives the application association of the next data comprising described relative address assembly View data cell, return to step 102;
In the present embodiment, the data due to relative address assembly may be sent out by multiple Application Protocol Data Units by subpackage Give JAVA smart card, so JAVA intelligence calorie requirement receives multiple Application Protocol Data Units and just can receive whole correlations The data of address components;
Specifically, reorientation is carried out to the first instruction, as shown in figure 3, including:
Step 201:JAVA smart card judges the reference type of the first instruction, if internal reference then execution step 202, if It is external reference then execution step 205;
Specifically, JAVA smart card judges whether the highest order of the 2nd byte of current item data is 1, is then to determine the The reference type of one instruction is external reference, otherwise determines that the reference type of the first instruction is internal reference;
For example, current item data is:0x010x810x030x00;2nd byte of current item data is 0x81, that is, 10000001, then the highest order of the 2nd byte of current item data is 1, determines that the reference type of the first instruction is external reference;
Step 202:The data of the Part I according to current item data for the JAVA smart card obtains the first deviant;
Specifically, the data of the Part I of current item data is the 2nd byte of current item data and the 3rd byte Data;
Step 203:JAVA smart card is according to the category information assembly initial address of the first deviant and JAVA smart cards for storage Obtain category information physical address;
Specifically, the first deviant adds that category information assembly initial address is equal to category information physical address;
Step 204:JAVA smart card obtains the deviant of category information according to category information physical address and EEPROM base address, Execution step 210;
Specifically, category information physical address deducts the deviant that EEPROM base address is equal to category information;In the present embodiment, class The deviant of information is the offset address based on EEPROM for the category information;
Step 205:JAVA smart card obtains the data of the Part II of current item data as being cited belonging to category information Bag bag ID;
Specifically, the data of the Part II of current item data is rear 7 data of the 2nd byte of current item data;
For example, current item data is:0x010x810x030x00;2nd byte of current item data is 0x81, that is, 10000001, then the bag ID of the bag being cited belonging to category information is 1;
Step 206:JAVA smart card judges that whether wrap ID is less than the first preset value, is then execution step 207, otherwise executes Step 208;
For example, the first preset value is 19;
Step 207:JAVA smart card updates the order code of the first instruction, execution step 208;
Specifically, JAVA smart card passes through to update the first finger that the first order code instructing will quote category information in EEPROM Order is changed to quote category information in ROM;
For example, first instruct as 0x8F0x000x03, category information in EEPROM is quoted in this first instruction;During first is instructed Order code 0x8F be changed to 0xBC, then first after changing instructs as 0xBC0x000x03, and the first instruction after change is quoted Category information in ROM;
Step 208:JAVA smart card obtains the derivation table address of bag according to bag ID;
Step 209:The data of the Part III according to current item data for the JAVA smart card and the derivation table address of bag, in bag Derived table in obtain category information deviant, execution step 210;
Specifically, the data of the Part III of current item data is the data of the 3rd byte of current item data;
For example, in the present embodiment, the data of the 3rd byte of current item data is 0x03, the category information getting inclined Shifting is worth for 0x010x81;
Step 210:The deviant of category information as the first parameter, is updated the first finger according to the first parameter by JAVA smart card The order parameter of order;
For example, first instruct as 0x8F0x000x03, the order parameter 0x000x03 during first is instructed is changed to obtain Deviant 0x010x81 of the category information arriving, then first after changing instructs as 0xBC0x010x81;
Specifically, reorientation is carried out to the second instruction, as shown in figure 4, including:
Step 301:JAVA smart card judges the reference type of the second instruction, if internal reference then execution step 302, if It is external reference then execution step 304;
Specifically, JAVA smart card judges whether the highest order of the 2nd byte of current item data is 1, is then to determine the The reference type of two instructions is external reference, otherwise determines that the reference type of the second instruction is internal reference;
For example, current item data is 0x020x010x030x00;2nd byte of current item data is 0x01, that is, 00000001, then the highest order of the 2nd byte of current item data is not 1;
Step 302:The data of the Part I according to current item data for the JAVA smart card obtains the first deviant;
Specifically, the data of the Part I of current item data is the 2nd byte of current item data and the 3rd byte Data;
For example, the data of the 2nd byte of current item data and the 3rd byte is 0x010x03, then the first deviant is 0x0103;
Step 303:JAVA smart card is according to the category information assembly initial address of the first deviant and JAVA smart cards for storage Obtain category information physical address, execution step 309;
Specifically, the first deviant adds that category information assembly initial address is equal to category information physical address;
For example, the type information assembly base address of JAVA smart cards for storage is 0x100380, then category information physical address is 0x100380+0x0103=0x100483;
Step 304:JAVA smart card obtains the data of the Part II of current item data as being cited belonging to category information Bag bag ID;
Specifically, the data of the Part II of current item data is rear 7 data of the 2nd byte of current item data;
Step 305:JAVA smart card obtains the derivation table address of bag according to bag ID;
Step 306:JAVA smart card judges that whether wrap ID is less than the first preset value, is then execution step 307, otherwise executes Step 308;
Step 307:The data of the Part III according to current item data for the JAVA smart card and the derivation table address of bag, in bag Derived table in obtain the deviant of category information, the deviant according to category information and ROM base address obtain category information physical address, Execution step 309;
Specifically, the data of the Part III of current item data is the data of the 3rd byte of current item data;Category information Deviant add ROM base address be equal to category information physical address;
Step 308:The data of the Part III according to current item data for the JAVA smart card and the derivation table address of bag, in bag Derived table in obtain the deviant of category information, the deviant according to category information and EEPROM base address obtain category information physically Location, execution step 309;
Specifically, the data of the Part III of current item data is the data of the 3rd byte of current item data;Category information Deviant add EEPROM base address be equal to category information physical address;
Step 309:JAVA smart card, according to category information physical address, obtains current class letter in JAVA smart cards for storage area Breath;
Step 310:JAVA smart card judges whether the data of the Part I of current category information is the second preset value, is then Execution step 311, otherwise execution step 312;
Specifically, the data of the Part I of current category information is the 5th of the 2nd byte of current category information;Second Preset value is 1;
For example, the 2nd byte of current category information is 0x13, that is, 00010011, then the 2nd byte of current category information 5th is 1, determines that the data of the Part I of current category information is the second preset value;
Step 311:The data of the Part II according to current category information for the JAVA smart card and ROM base address, obtain current The physical address of the category information of the parent of category information, execution step 313;
Specifically, the data of the Part II of current category information is the 3rd byte of current category information and the 4th byte Data;The data of the 3rd byte of current category information and the 4th byte adds that ROM base address is equal to the parent of current category information Category information physical address;
For example, ROM base address is 0x32000, and the 3rd byte of current category information and the data of the 4th byte are 0x020x03, then the physical address of the category information of parent of current category information is 0x32000+0x0203=0x32203;
Step 312:The data of the Part II according to current category information for the JAVA smart card and EEPROM base address, are worked as The physical address of the category information of the parent of front category information, execution step 313;
Specifically, the data of the Part II of current category information is the 3rd byte of current category information and the 4th byte Data;The data of the 3rd byte of current category information and the 4th byte adds that EEPROM base address is equal to the father of current category information The physical address of the category information of class;
Step 313:The physical address of the category information of the parent according to current category information for the JAVA smart card, in JAVA smart card The data of the Part I of the category information of the parent of current category information is obtained, according to this data and current item data in memory block The data of Part IV obtains index value;
Specifically, the data of the Part I of the category information of the parent of current category information is the class of the parent of current category information The data of the 5th byte of information;The data of the Part IV of current item data is the number of the 4th byte of current item data According to;The data of the 5th byte of the category information of parent of current category information adds data of the 4th byte of current item data etc. In index value;
For example, the physical address of the category information of the parent of current category information is 0x32203, the current category information getting The data of the 5th byte of the category information of parent is 0x02, and the 4th byte of current item data is 0x00, then index value is 0x00+0x02=0x02;
Step 314:Index value as the first parameter, is updated the instruction of the second instruction by JAVA smart card according to the first parameter Parameter;
For example, second instruct as 0x830x23, then the order parameter 0x23 of the second instruction is updated to index value 0x02, that is, After renewal second instructs as 0x830x02;
Specifically, reorientation is carried out to the 3rd instruction, as shown in figure 5, including:
Step 401:JAVA smart card judges the reference type of the 3rd instruction, if internal reference then execution step 402, if It is external reference then execution step 404;
Specifically, JAVA smart card judges whether the highest order of the 2nd byte of current item data is 1, is then to determine the The reference type of three instructions is external reference, otherwise determines that the reference type of the 3rd instruction is internal reference;
For example, current item data is 0x030x020x050x01;2nd byte of current item data is 0x02, that is, 00000010, then the highest order of the 2nd byte of current item data is not 1, determines that the reference type of the 3rd instruction draws for inside With;
Step 402:The data of the Part I according to current item data for the JAVA smart card obtains the first deviant;
Specifically, the data of the Part I of current item data is the 2nd byte of current item data and the 3rd byte Data;
For example, the data of the 2nd byte of current item data and the 3rd byte is 0x020x05, then the first deviant is 0x0205;
Step 403:JAVA smart card is according to the category information assembly initial address of the first deviant and JAVA smart cards for storage Obtain category information physical address, execution step 409;
Specifically, the first deviant adds that category information assembly initial address is equal to category information physical address;
For example, the type information assembly base address of JAVA smart cards for storage is 0x100380, and the first deviant is 0x0205, Then category information physical address is 0x100380+0x0205=0x100585;
Step 404:JAVA smart card obtains the data of the Part II of current item data as being cited belonging to category information Bag bag ID;
Specifically, the data of the Part II of current item data is rear 7 data of the 2nd byte of current item data;
Step 405:JAVA smart card obtains the derivation table address of bag according to bag ID;
Step 406:JAVA smart card judges that whether wrap ID is less than the first preset value, is then execution step 407, otherwise executes Step 408;
Specifically, the first preset value is 19;
Step 407:The data of the Part III according to current item data for the JAVA smart card and the derivation table address of bag, in bag Derived table in obtain the deviant of category information, the deviant according to category information and ROM base address obtain category information physical address, Execution step 409;
Specifically, the data of the Part III of current item data is the data of the 3rd byte of current item data;Category information Deviant add ROM base address be equal to category information physical address;
Step 408:The data of the Part III according to current item data for the JAVA smart card and the derivation table address of bag, in bag Derived table in obtain the deviant of category information, the deviant according to category information and EEPROM base address obtain category information physically Location, execution step 409;
Specifically, the data of the Part III of current item data is the data of the 3rd byte of current item data;Category information Deviant add EEPROM base address be equal to category information physical address;
Step 409:JAVA smart card obtains according to the data of category information physical address and the Part IV of current item data The physical address of called method;
Specifically, the data of the Part IV of current item data is the data of the 4th byte of current item data;Currentitem The data of the 4th byte of data is the sequence number of called method, and JAVA smart card is believed in class according to the sequence number of called method The offset address of called method is searched in breath;
For example, category information physical address is 0x100585, and the data of the 4th byte of current item data is 0x01;Search The offset address of the called method arriving is 0x100680;
Step 410:JAVA smart card obtains quilt according to the physical address of called method in JAVA smart cards for storage area The number of parameters of call method;
Specifically, JAVA smart card obtains in JAVA smart cards for storage area according to the physical address of called method and is called Method information, obtain called method information the 2nd byte data as called method number of parameters;
For example, the number of parameters of the called method getting is 0x03;
Step 411:JAVA smart card is according to the number of the number of parameters of called method and the Part IV of current item data According to obtaining the first parameter;
Specifically, the data of the Part IV of current item data is the data of the 4th byte of current item data;
For example, the number of parameters of called method is 0x03, and the data of the 4th byte of current item data is 0x01, then First parameter is 0x030x01;
Step 412:JAVA smart card updates the order parameter of the 3rd instruction according to the first parameter;
For example, the 3rd instruct as 0x8B0x000x07, then the order parameter 0x000x07 of the 3rd instruction is updated to first Parameter 0x030x01, then the 3rd after updating instructs as 0x8B0x030x01;
Specifically, reorientation is carried out to the 4th instruction, as shown in fig. 6, including:
Step 501:JAVA smart card judges the reference type of the 4th instruction, if internal reference then execution step 502, if It is external reference then execution step 504;
Specifically, JAVA smart card judges whether the highest order of the 2nd byte of current item data is 1, is then to determine the The reference type of four instructions is external reference, otherwise determines that the reference type of the 4th instruction is internal reference;
For example, current item data is 0x040x030x060x02;2nd byte of current item data is 0x03, that is, 00000011, then the highest order of the 2nd byte of current item data is not 1;
Step 502:The data of the Part I according to current item data for the JAVA smart card obtains the first deviant;
Specifically, the data of the Part I of current item data is the 2nd byte of current item data and the 3rd byte Data;
For example, in the present embodiment, the 2nd byte of current item data and the data of the 3rd byte are 0x030x06, then the One deviant is 0x0306;
Step 503:JAVA smart card is according to the category information assembly initial address of the first deviant and JAVA smart cards for storage Obtain category information physical address, execution step 510;
Specifically, the first deviant adds that category information assembly initial address is equal to category information physical address;
For example, the category information assembly initial address of JAVA smart cards for storage is 0x100380, and the first deviant is 0x0306, Then category information physical address is 0x100380+0x0306=0x100686;
Step 504:JAVA smart card obtains the data of the Part II of current item data as being cited belonging to category information Bag bag ID;
Specifically, the data of the Part II of current item data is rear 7 data of the 2nd byte of current item data;
Step 505:JAVA smart card obtains the derivation table address of bag according to bag ID;
Step 506:JAVA smart card judges that whether wrap ID is less than the first preset value, is then execution step 507, otherwise executes Step 509;
Specifically, the first preset value is 19;
Step 507:The data of the Part III according to current item data for the JAVA smart card and the derivation table address of bag, in bag Derived table in obtain the deviant of category information, the deviant according to category information and ROM base address obtain category information physical address, Execution step 508;
Specifically, the data of the Part III of current item data is the data of the 3rd byte of current item data;Category information Deviant add ROM base address be equal to category information physical address;
Step 508:JAVA smart card updates the order code of the 4th instruction, execution step 510;
Specifically, JAVA smart card will call the 4th finger of paternal method in EEPROM by updating the order code of the 4th instruction Order is changed to call paternal method in ROM;
Step 509:The data of the Part III according to current item data for the JAVA smart card and the derivation table address of bag, in bag Derived table in obtain the deviant of category information, the deviant according to category information and EEPROM base address obtain category information physically Location, execution step 510;
Specifically, the data of the Part III of current item data is the data of the 3rd byte of current item data;Category information Deviant add EEPROM base address be equal to category information physical address;
Step 510:JAVA smart card obtains according to the data of category information physical address and the Part IV of current item data The offset address of called method;
Specifically, the data of the Part IV of current item data is the data of the 4th byte of current item data;Currentitem The data of the 4th byte of data is the sequence number of called method, and JAVA smart card is believed in class according to the sequence number of called method The offset address of called method is found in breath;
For example, the data of the 4th byte of current item data is 0x02, and category information physical address is 0x100686;Search The offset address of the called method arriving is 0x0680;
Step 511:The offset address of called method as the first parameter, is updated by JAVA smart card according to the first parameter The order parameter of the 4th instruction;
For example, the 4th instruct as 0x8C0x010x07, the order parameter 0x010x07 of the 4th instruction is updated to be called The offset address 0x0680 of method, then the 4th after updating instructs as 0x8C0x060x80;
Specifically, reorientation is carried out to the 5th instruction, as shown in fig. 7, comprises:
Step 601:JAVA smart card judges the reference type of the 5th instruction, if internal reference then execution step 602, if It is external reference then execution step 605;
Specifically, JAVA smart card judges whether the highest order of the 2nd byte of current item data is 1, is then to determine the The reference type of five instructions is external reference, otherwise determines that the reference type of the 5th instruction is internal reference;
For example, current item data is 0x050x030x060x02;2nd byte of current item data is 0x03, that is, 00000011, then the highest order of the 2nd byte of current item data is not 1, determines that the reference type of the 5th instruction draws for inside With;
Step 602:The data of the Part V according to current item data for the JAVA smart card obtains the second deviant;
Specifically, the data of the Part V of current item data is the 3rd byte of current item data and the 4th byte Data;
For example, the data of the 3rd byte of current item data and the 4th byte is 0x060x02, then the second deviant is 0x0602;
Step 603:JAVA smart card is according to the static fields assembly initial address of the second deviant and JAVA smart cards for storage Obtain static fields physical address;
Specifically, the second deviant adds that in this bag, category information assembly initial address is equal to category information physical address;
For example, the static fields assembly initial address of JAVA smart cards for storage is 0x100680, and the second deviant is 0x0602, Then static fields physical address is 0x100680+0x0602=0x100C82;
Step 604:JAVA smart card obtains accessed static fields according to static fields physical address and EEPROM base address Offset address, execution step 608;
Specifically, static fields physical address deducts the offset address that EEPROM base address is equal to accessed static fields;
For example, static fields physical address is 0x100C82, and EEPROM base address is 0x100380, then be accessed static fields Offset address is 0x100C82 0x100380=0x0902;
Step 605:JAVA smart card obtains the data of the Part II of current item data as being cited belonging to category information Bag bag ID;
Specifically, the data of the Part II of current item data is rear 7 data of the 2nd byte of current item data;
Step 606:JAVA smart card obtains the derivation table address of bag according to bag ID;
Step 607:The data of the Part I according to current item data for the JAVA smart card and the derivation table address of bag, are leading Go out the offset address obtaining accessed static fields in table;
Specifically, the data of the Part I of current item data is the 2nd byte of current item data and the 3rd byte Data;
Step 608:JAVA smart card using the offset address of accessed static fields as the first parameter, according to the first parameter more The order parameter of new 5th instruction;
For example, the 5th instruct as 0x7B0x000x37, the order parameter 0x000x37 of the 5th instruction is updated to be accessed The offset address 0x0902 of static fields, then the 5th after updating instructs as 0x7B0x090x02;
Specifically, reorientation is carried out to the 6th instruction, as shown in figure 8, including:
Step 701:JAVA smart card judges the reference type of the 6th instruction, if internal reference then execution step 705, if It is external reference then execution step 702;
Specifically, JAVA smart card judges whether the highest order of the 2nd byte of current item data is 1, is then to determine the The reference type of six instructions is external reference, otherwise determines that the reference type of the 6th instruction is internal reference;
For example, current item data is 0x060x030x060x02;2nd byte of current item data is 0x03, that is, 00000011, then the highest order of the 2nd byte of current item data is not 1, determines that the reference type of the 6th instruction draws for inside With;
Step 702:The data of the Part V according to current item data for the JAVA smart card obtains the second deviant;
Specifically the data of the Part V of current item data is the 3rd byte of current item data and the 4th byte Data;
For example, the data of the 3rd byte of current item data and the 4th byte is 0x060x02, then the second deviant is 0x0602;
Step 703:JAVA smart card obtains according to the method assembly initial address of the second deviant and JAVA smart cards for storage To method physical address;
Specifically, the second deviant adds that method assembly initial address is equal to method physical address;
For example, the method assembly initial address of JAVA smart cards for storage is 0x100680, and the second deviant is 0x0602, then Method physical address is 0x100680+0x0602=0x100C82;
Step 704:JAVA smart card obtains the deviant of method according to method physical address and EEPROM base address, execution Step 710;
Specifically, method physical address deducts the deviant that EEPROM base address is equal to method;In the present embodiment, method Deviant is the offset address based on EEPROM for the method;
For example, method physical address is 0x100C82, and EEPROM base address is 0x100380, then the deviant of method is 0x100C82–0x100380=0x0902;
Step 705:JAVA smart card obtains the data of the Part II of current item data as belonging to called method The bag ID of bag;
Specifically, the data of the Part II of current item data is rear 7 data of the 2nd byte of current item data;
Step 706:JAVA smart card judges that whether wrap ID is less than the first preset value, is then execution step 707, otherwise executes Step 708;
Specifically, the first preset value is 19;
Step 707:JAVA smart card updates the order code of the 6th instruction, execution step 708;
Specifically, JAVA smart card will call static method the 6th finger in EEPROM by updating the order code of the 6th instruction Order is changed to call static method in ROM;
Step 708:JAVA smart card obtains the derivation table address of bag according to bag ID;
Step 709:The data of the Part V according to current item data for the JAVA smart card and the derivation table address of bag, in bag Derived table in acquisition methods deviant;
Specifically, the data of the Part V of current item data is the 3rd byte of current item data and the 4th byte Data;
Step 710:The deviant of method as the first parameter, is updated the 6th instruction according to the first parameter by JAVA smart card Order parameter;
For example, the 6th instruct as 0x8D0x000x37, the order parameter 0x000x37 of the 6th instruction is updated to method Deviant 0x0902, then the 6th after updating instructs as 0x8D0x090x02;
In the present embodiment, step 101 to step 110 can be replaced:
Step s2-1:JAVA smart card obtains the length of relative address assembly from the Application Protocol Data Unit receiving Degree, obtains the length number of the double byte correction data in relative address assembly from Application Protocol Data Unit according to reading address According to as the first untreatment data length, according to the length of the length data getting, update and read address and reduced data Length;
Specifically, the initial value reading address is the head of the length data of double byte correction data in relative address assembly Address;
Step s2-2:According to the first untreatment data length, JAVA smart card judges whether that untreated double byte is repaiied Correction data, is then execution step s2-3, otherwise execution step s2-6;
Step s2-3:JAVA smart card obtains relative address assembly according to reading address from Application Protocol Data Unit The data of 1 byte, as the first correction data, according to the data in the relative address assembly reading, updates first untreated The length of data length, reading address and reduced data;
Step s2-4:JAVA smart card updates, according to the first correction data, the first physical address being relocated data;
Specifically, the initial value being relocated the first physical address of data is the method assembly base of JAVA smart cards for storage Address;
Step s2-5:JAVA smart card is according to being relocated the first physical address of data from JAVA smart cards for storage area The data obtaining 2 bytes is as the index value in constant pool component, execution step 111;
Step s2-6:JAVA smart card judges whether to obtain the list of relative address assembly from Application Protocol Data Unit The length data of byte correction data, as the second untreatment data length, is then execution step s2-7, otherwise JAVA smart card The length of the single byte correction data of relative address assembly is obtained according to reading address from the Application Protocol Data Unit receiving As the second untreatment data length, the length according to the length data getting updates and reads address and processed number degrees of data According to length, execution step s2-7;
Step s2-7:According to the second untreatment data length, JAVA smart card judges whether that untreated single byte is repaiied Correction data, is then execution step s2-8, otherwise returns success, and terminates;
Step s2-8:JAVA smart card obtains relative address assembly according to reading address from Application Protocol Data Unit The data of 1 byte, as the second correction data, according to the data in the relative address assembly reading, updates second untreated The length of data length, reading address and reduced data;
Step s2-9:JAVA smart card updates, according to the second correction data, the second physical address being relocated data;
Specifically, the initial value being relocated the second physical address of data is the method assembly base of JAVA smart cards for storage Address;
Step s2-10:JAVA smart card is according to being relocated the second physical address of data from JAVA smart cards for storage area The middle data obtaining 1 byte is as the index value in constant pool component, execution step 111;
In addition, step 101 can be replaced to step 110:
Step s3-1:JAVA smart card obtains the length of relative address assembly from the Application Protocol Data Unit receiving Degree, obtains the length number of the single byte correction data in relative address assembly from Application Protocol Data Unit according to reading address According to the double byte correction data as the first untreatment data length, obtaining in relative address assembly length data as second Untreatment data length, updates the length reading address and reduced data according to the length data getting;
Specifically, the initial value reading address is the head of the length data of single byte correction data in relative address assembly Address;
Step s3-2:According to the first untreatment data length, JAVA smart card judges whether that untreated single byte is repaiied Correction data, is then execution step s3-3, otherwise execution step s3-6;
Step s3-3:JAVA smart card obtains relative address assembly according to reading address from Application Protocol Data Unit The data of 1 byte, as the first correction data, according to the data in the relative address assembly reading, updates first untreated The length of data length, reading address and reduced data;
Step s3-4:JAVA smart card updates, according to the first correction data, the first physical address being relocated data;
Specifically, the initial value being relocated the first physical address of data is the method assembly base of JAVA smart cards for storage Address;
Step s3-5:JAVA smart card is according to being relocated the first physical address of data from JAVA smart cards for storage area The data obtaining 1 byte is as the index value in constant pool component, execution step 111;
Step s3-6:According to the second untreatment data length, JAVA smart card judges whether that untreated double byte is repaiied Correction data, is then execution step s3-7, otherwise returns success, and terminates;
Step s3-7:JAVA smart card obtains relative address assembly according to reading address from Application Protocol Data Unit The data of 1 byte, as the second correction data, according to the data in the relative address assembly reading, updates second untreated The length of data length, reading address and reduced data;
Step s3-8:JAVA smart card updates, according to the second correction data, the second physical address being relocated data;
Specifically, the initial value being relocated the second physical address of data is the method assembly base of JAVA smart cards for storage Address;
Step s3-9:JAVA smart card is according to being relocated the second physical address of data from JAVA smart cards for storage area The data obtaining 2 bytes is as the index value in constant pool component, execution step 111.
In addition, step 101 can be replaced to step 110:
Step s4-1:JAVA smart card obtains the length of relative address assembly from the Application Protocol Data Unit receiving Degree, obtains the length number of the double byte correction data in relative address assembly from Application Protocol Data Unit according to reading address According to the single byte correction data as the first untreatment data length, obtaining in relative address assembly length data as second Untreatment data length, according to the length of the length data getting, updates the length reading address and reduced data;
Specifically, the initial value reading address is the head of the length data of double byte correction data in relative address assembly Address;
Step s4-2:According to the first untreatment data length, JAVA smart card judges whether that untreated double byte is repaiied Correction data, is then execution step s4-3, otherwise execution step s4-6;
Step s4-3:JAVA smart card obtains relative address assembly according to reading address from Application Protocol Data Unit The data of 1 byte, as the first correction data, according to the data in the relative address assembly reading, updates first untreated The length of data length, reading address and reduced data;
Step s4-4:JAVA smart card updates, according to the first correction data, the first physical address being relocated data;
Specifically, the initial value being relocated the first physical address of data is the method assembly base of JAVA smart cards for storage Address;
Step s4-5:JAVA smart card is according to being relocated the first physical address of data from JAVA smart cards for storage area The data obtaining 2 bytes is as the index value in constant pool component, execution step 111;
Step s4-6:According to the second untreatment data length, JAVA smart card judges whether that untreated single byte is repaiied Correction data, is then execution step s4-7, otherwise returns success, and terminates;
Step s4-7:JAVA smart card obtains relative address assembly according to reading address from Application Protocol Data Unit The data of 1 byte is as the second correction data;According to the data in the relative address assembly reading, update second untreated Data length and reading address;
Step s4-8:JAVA smart card updates, according to the second correction data, the second physical address being relocated data;
Specifically, the initial value being relocated the second physical address of data is the method assembly base of JAVA smart cards for storage Address;
Step s4-9:JAVA smart card is according to being relocated the second physical address of data from JAVA smart cards for storage area The data obtaining 1 byte is as the index value in constant pool component, execution step 111.
Embodiment 3
Embodiments of the invention 3 provide a kind of device of efficient renewal JAVA instruction, as shown in figure 9, this device includes:The One acquisition module 301, the second acquisition module 302, the first judge module 303, first processing module 304, Second processing module 305th, the first update module 306 and output module 307;
First acquisition module 301, for obtaining the correction data of relative address assembly, root from Application Protocol Data Unit Obtain the index value in constant pool component according to revising data from JAVA smart cards for storage area;
Second acquisition module 302, for existing according to the index value in first acquisition 301 pieces of constant pool component getting of mould Obtain current item data in constant pool component, judge whether to get current item data;
First judge module 303, for when the second acquisition module 302 gets current item data, according to current item number According to the 1st byte judge current item data corresponding JAVA instruction reference type;
First processing module 304, for judging drawing of current item data corresponding JAVA instruction when the first judge module 303 When being internal reference with type, deviant is obtained according to the first predetermined fraction of current item data, is referred to according to deviant and JAVA Corresponding assembly initial address is made to obtain the first parameter;
Second processing module 305, for judging drawing of current item data corresponding JAVA instruction when the first judge module 303 When being external reference with type, obtain the derivation table address wrapping according to the second predetermined fraction of current item data, according to currentitem The table address of deriving of data and bag obtains the first parameter in the derived table of bag;
First update module 306, for, after first processing module 304 obtains the first parameter, updating according to the first parameter The order parameter of JAVA instruction;After Second processing module 305 obtains the first parameter, JAVA instruction is updated according to the first parameter Order parameter;
Output module 307, for when the second acquisition module 302 does not get current item data, returning error message.
Device also includes:3rd acquisition module and the second judge module;
3rd acquisition module, for obtaining relative address according to reading address from the Application Protocol Data Unit receiving As untreatment data length, the length according to the length data getting updates and reads ground the length of the correction data in assembly Location;The initial value reading address is the first address of the length data of correction data in relative address assembly;
Second judge module, for judging whether not according to the untreatment data length that the 3rd acquisition module gets The correction data processing;
Output module 307, is additionally operable to, when the second judge module judges not existing untreated correction data, return successfully Information;
First acquisition module 301, specifically for obtaining relative address according to reading address from Application Protocol Data Unit The correction data of assembly, obtains the index value in constant pool component from JAVA smart cards for storage area according to correction data, according to The correction data of the relative address assembly reading, updates untreatment data length and reads address;
Device also includes the 3rd judge module and receiver module;
3rd judge module, for, after the first update module 306 updates the order parameter that JAVA instructs, judging that this connects Whether the data of the relative address assembly in the Application Protocol Data Unit receiving is treated to complete;
Output module 307, is additionally operable to judge in this Application Protocol Data Unit receiving when the 3rd judge module Data is treated when completing, and returns success;
Receiver module, for having judged the data in this Application Protocol Data Unit receiving when the 3rd judge module Treated when completing, wait and receive the Application Protocol Data Unit of the data that the next one comprises described relative address assembly.
3rd acquisition module includes first acquisition unit and second acquisition unit;
First acquisition unit, for obtaining relative address according to reading address from the Application Protocol Data Unit receiving The length data of the single byte correction data in assembly as the first untreatment data length, according to the length data getting Length updates and reads address;The initial value reading address is the length data of single byte correction data in relative address assembly First address;
When the 4th judge module, second acquisition unit, for judging that the length data not getting double byte correction data is made During for the second untreatment data length, obtain relative address group from the Application Protocol Data Unit receiving according to reading address The length data of the double byte correction data of part as the second untreatment data length, according to the length of the length data getting Update and read address;
Second judge module includes the first judging unit and the second judging unit;
First judging unit, for after first acquisition unit gets the first untreatment data length, according to first not Processing data length judges whether untreated single byte correction data;
When the 4th judge module, second judging unit, for judging that the length data having got double byte correction data is made When getting the second untreatment data length for the second untreatment data length or second acquisition unit, according to the second untreated number Judge whether untreated double byte correction data according to length;
Output module 307, is additionally operable to, when the second judging unit judges there is not untreated double byte correction data, return Return successful information;
First acquisition module 301 includes the 3rd acquiring unit, the first updating block and the 4th acquiring unit;
3rd acquiring unit, for when first judging unit judge there is untreated single byte correction data when, according to The data reading 1 byte that address obtains relative address assembly from Application Protocol Data Unit revises data as first, According to the data in the relative address assembly reading, update the first untreatment data length and read address;
First updating block, the first correction data for being got according to the 3rd acquiring unit updates and is relocated data The first physical address;The initial value being relocated the first physical address of data is the method assembly base of JAVA smart cards for storage Address;
4th acquiring unit, for the first physical address being relocated data being obtained according to the first updating block renewal Obtain the data of 1 byte as the index value in constant pool component from JAVA smart cards for storage area;
Device includes the 4th judge module, for judging there is not untreated single byte correction number when the first judging unit According to when, judge whether to get the length data of double byte correction data as the second untreatment data length;
First acquisition module 301 includes the 5th acquiring unit, the second updating block and the 6th acquiring unit;
5th acquiring unit, for when second judging unit judge there is untreated double byte correction data when, according to The data reading 1 byte that address obtains relative address assembly from Application Protocol Data Unit revises data as second, According to the data in the relative address assembly reading, update the second untreatment data length and read address;
Second updating block, the second correction data for being got according to the 5th acquiring unit updates and is relocated data The second physical address;The initial value being relocated the second physical address of data is the method assembly base of JAVA smart cards for storage Address;
6th acquiring unit, for the second physical address being relocated data being obtained according to the second updating block renewal Obtain the data of 2 bytes as the index value in constant pool component from JAVA smart cards for storage area.
In addition, the 3rd acquisition module includes the 7th acquiring unit and the 8th acquiring unit;
7th acquiring unit, for obtaining relative address according to reading address from the Application Protocol Data Unit receiving The length data of the double byte correction data in assembly as the first untreatment data length, according to the length data getting Length updates and reads address;The initial value reading address is the length data of double byte correction data in relative address assembly First address;
When the 5th judge module, 8th acquiring unit, for judging that the length data not getting single byte correction data is made During for the second untreatment data length, obtain relative address group from the Application Protocol Data Unit receiving according to reading address The length data of the single byte correction data of part as the second untreatment data length, according to the length of the length data getting Update and read address;
Second judge module includes the 3rd judging unit and the 4th judging unit;
3rd judging unit, for after the 7th acquiring unit gets the first untreatment data length, according to first not Processing data length judges whether untreated double byte correction data;
When the 5th judge module, 4th judging unit, for judging that the length data having got single byte correction data is made When getting the second untreatment data length for the second untreatment data length or the 8th acquiring unit, according to the second untreated number Judge whether untreated single byte correction data according to length;
Output module 307, is additionally operable to, when the 4th judging unit judges there is not untreated single byte correction data, return Return successful information;
First acquisition module 301 includes the 9th acquiring unit, the 3rd updating block and the tenth acquiring unit;
9th acquiring unit, for when the 3rd judging unit judge there is untreated double byte correction data when, according to The data reading 1 byte that address obtains relative address assembly from Application Protocol Data Unit revises data as first, According to the data in the relative address assembly reading, update the first untreatment data length and read address;
3rd updating block, the first correction data for being got according to the 9th acquiring unit updates and is relocated data The first physical address;The initial value being relocated the first physical address of data is the method assembly base of JAVA smart cards for storage Address;
Tenth acquiring unit, for the first physical address being relocated data being obtained according to the 3rd updating block renewal Obtain the data of 2 bytes as the index value in constant pool component from JAVA smart cards for storage area;
Device includes the 5th judge module, for judging there is not untreated double byte correction number when the 3rd judging unit According to when, judge whether to get the length data of single byte correction data as the second untreatment data length;
First acquisition module 301 includes the 11st acquiring unit, the 4th updating block and the 12nd acquiring unit;
11st acquiring unit, for when the 4th judging unit judge there is untreated single byte correction data when, root Revise number according to the data reading 1 byte that address obtains relative address assembly from Application Protocol Data Unit as second According to according to the data in the relative address assembly reading, renewal the second untreatment data length and reading address;
4th updating block, the second correction data for being got according to the 11st acquiring unit updates and is relocated number According to the second physical address;The initial value being relocated the second physical address of data is the method assembly of JAVA smart cards for storage Base address;
12nd acquiring unit, for updated according to the 4th updating block obtain be relocated the second of data physically Location obtains the data of 1 byte as the index value in constant pool component from JAVA smart cards for storage area.
In addition, the 3rd acquisition module is specifically for according to reading address from the Application Protocol Data Unit receiving The middle length data obtaining the single byte correction data in relative address assembly, as the first untreatment data length, obtains related The length data of the double byte correction data in address components as the second untreatment data length, according to the length number getting According to length update read address;The initial value reading address is the length number of the single byte correction data in relative address assembly According to first address;
Second judge module includes the 5th judging unit and the 6th judging unit;
5th judging unit, for after the 3rd acquisition module gets the first untreatment data length, according to first not Processing data length judges whether untreated single byte correction data;
6th judging unit, for when the 5th judging unit judge there is not untreated single byte correction data when, root Judge whether untreated double byte correction data according to the second untreatment data length that the 3rd acquisition module gets;
Output module 307, is additionally operable to, when the 6th judging unit judges there is not untreated double byte correction data, return Return successful information;
First acquisition module 301 includes the 13rd acquiring unit, the 5th updating block and the 14th acquiring unit;
13rd acquiring unit, for when the 5th judging unit judge there is untreated single byte correction data when, root Revise number according to the data reading 1 byte that address obtains relative address assembly from Application Protocol Data Unit as first According to according to the data in the relative address assembly reading, renewal the first untreatment data length and reading address;
5th updating block, the first correction data for being got according to the 13rd acquiring unit updates and is relocated number According to the first physical address;The initial value being relocated the first physical address of data is the method assembly of JAVA smart cards for storage Base address;
14th acquiring unit, for updated according to the 5th updating block obtain be relocated the first of data physically Location obtains the data of 1 byte as the index value in constant pool component from JAVA smart cards for storage area;
First acquisition module 301 includes the 15th acquiring unit, the 6th updating block and the 16th acquiring unit;
15th acquiring unit, for when the 6th judging unit judge there is untreated double byte correction data when, root Revise number according to the data reading 1 byte that address obtains relative address assembly from Application Protocol Data Unit as second According to according to the data in the relative address assembly reading, renewal the second untreatment data length and reading address;
6th updating block, the second correction data for being got according to the 15th acquiring unit updates and is relocated number According to the second physical address;The initial value being relocated the second physical address of data is the method assembly of JAVA smart cards for storage Base address;
16th acquiring unit, for updated according to the 6th updating block obtain be relocated the second of data physically Location obtains the data of 2 bytes as the index value in constant pool component from JAVA smart cards for storage area.
In addition, the 3rd acquisition module is specifically for according to reading address from the Application Protocol Data Unit receiving The middle length data obtaining the double byte correction data in relative address assembly, as the first untreatment data length, obtains related The length data of the single byte correction data in address components as the second untreatment data length, according to the length number getting According to length update read address;The initial value reading address is the length number of the double byte correction data in relative address assembly According to first address;
Second judge module includes the 7th judging unit and the 8th judging unit;
7th judging unit, for after the 3rd acquisition module gets the first untreatment data length, according to first not Processing data length judges whether untreated double byte correction data;
8th judging unit, for when the 7th judging unit judge there is not untreated double byte correction data when, root Judge whether untreated single byte correction data according to the second untreatment data length that the 3rd acquisition module gets;
Output module 307, is additionally operable to, when the 8th judging unit judges there is not untreated single byte correction data, return Return successful information;
First acquisition module 301 includes the 17th acquiring unit, the 7th updating block and the 18th acquiring unit;
17th acquiring unit, for when the 7th judging unit judge there is untreated double byte correction data when, root Revise number according to the data reading 1 byte that address obtains relative address assembly from Application Protocol Data Unit as first According to according to the data in the relative address assembly reading, renewal the first untreatment data length and reading address;
7th updating block, the first correction data for being got according to the 17th acquiring unit updates and is relocated number According to the first physical address;The initial value being relocated the first physical address of data is the method assembly of JAVA smart cards for storage Base address;
18th acquiring unit, for updated according to the 7th updating block obtain be relocated the first of data physically Location obtains the data of 2 bytes as the index value in constant pool component from JAVA smart cards for storage area;
First acquisition module 301 includes the 19th acquiring unit, the 8th updating block and the 20th acquiring unit;
19th acquiring unit, for when the 8th judging unit judge there is untreated single byte correction data when, root Revise number according to the data reading 1 byte that address obtains relative address assembly from Application Protocol Data Unit as second According to according to the data in the relative address assembly reading, renewal the second untreatment data length and reading address;
8th updating block, the second correction data for being got according to the 19th acquiring unit updates and is relocated number According to the second physical address;The initial value being relocated the second physical address of data is the method assembly of JAVA smart cards for storage Base address;
20th acquiring unit, for updated according to the 8th updating block obtain be relocated the second of data physically Location obtains the data of 1 byte as the index value in constant pool component from JAVA smart cards for storage area.
Device includes the 4th acquisition module, the 6th judge module, the 7th judge module and receiver module;
4th acquisition module, for obtaining relative address according to reading address from the Application Protocol Data Unit receiving As untreatment data length, the length according to the length data getting updates to be read the length data of the correction data in assembly Take address;The initial value reading address is the first address of the length data of correction data in relative address assembly;
First acquisition module 301, specifically for obtaining relative address according to reading address from Application Protocol Data Unit The correction data of assembly, obtains the index value in constant pool component from JAVA smart cards for storage area according to correction data, according to The correction data of the relative address assembly reading, updates untreatment data length and reads address;
6th judge module, for after the first update module 306 updates the order parameter that JAVA instructs, judging whether to locate The all data in relative address assembly are managed;
Output module 307, is additionally operable to judge all data in processed relative address assembly when the 6th judge module Afterwards, return success;
7th judge module, for judging all data in untreated complete relative address assembly when the 6th judge module Afterwards, judge whether the data of the relative address assembly in this Application Protocol Data Unit receiving is treated to complete;
Output module 307, is additionally operable to judge in this Application Protocol Data Unit receiving when the 7th judge module After the completion of data is treated, return success;
Receiver module, for having judged the data in this Application Protocol Data Unit receiving when the 7th judge module After the completion of treated, wait and receive the Application Protocol Data Unit of the data that the next one comprises described relative address assembly.
If the current corresponding JAVA of item data instructs instructing for first, the first judge module 303, specifically for judging first The reference type of instruction;
First processing module 304, the reference type specifically for judging the first instruction when the first judge module 303 is internal When quoting, the data of the Part I according to current item data obtains the first deviant, according to the first deviant and JAVA intelligence The category information assembly initial address of card storage obtains category information physical address, according to category information physical address and EEPROM base address Obtain the deviant of category information;
Second processing module 305 includes the 21st acquiring unit, the 9th judging unit, the 9th updating block and the 20th Two acquiring units;
21st acquiring unit, for judging that when the first judge module 303 reference type of the first instruction draws for outside Used time, obtain current item data Part II data as the bag being cited belonging to category information bag ID;
9th judging unit, for judging whether the bag ID that the 21st acquiring unit gets is less than the first preset value;
9th updating block, for when the 9th judging unit judges that bag ID is less than the first preset value, updating the first instruction Order code;
When the 9th judging unit, 22nd acquiring unit, for judging that bag ID is not less than the first preset value or the 9th renewal After unit updates the order code of the first instruction, obtain the derivation table address of bag according to bag ID, according to the 3rd of current item data The data divided and the derivation table address of bag, obtain the deviant of category information in the derived table of bag;
First update module 306, specifically for after first processing module 304 obtains deviant, by the skew of category information Value, as the first parameter, updates the order parameter of the first instruction according to the first parameter;When the 22nd acquiring unit gets partially After shifting value, using the deviant of category information as the first parameter, update the order parameter of the first instruction according to the first parameter.
If the current corresponding JAVA of item data instructs instructing for second, the first judge module 303, specifically for judging second The reference type of instruction;
First processing module 304, the reference type specifically for judging the second instruction when the first judge module 303 is internal When quoting, the data of the Part I according to current item data obtains the first deviant, according to the first deviant and JAVA intelligence The category information assembly initial address of card storage obtains category information physical address, according to category information physical address and EEPROM base address Obtain the deviant of category information;
Second processing module 305 include the 23rd acquiring unit, the tenth judging unit, at first processing units and second Reason unit;
23rd acquiring unit, for judging that when the first judge module 303 reference type of the second instruction draws for outside Used time, the data of Part II obtaining current item data, as the bag ID of the bag being cited belonging to category information, obtains according to bag ID Take the derivation table address of bag;
Tenth judging unit, for judging whether the bag ID that the 23rd acquiring unit gets is less than the first preset value;
First processing units, for when the tenth judging unit judges that bag ID is less than the first preset value, according to current item number According to the data of Part III and the derivation table address of bag, bag derived table in obtain category information deviant, according to class believe The deviant of breath and ROM base address obtain category information physical address;
Second processing unit, for when the tenth judging unit judges that bag ID is not less than the first preset value, according to currentitem The derivation table address of the data of the Part III of data and bag, obtains the deviant of category information, according to class in the derived table of bag The deviant of information and EEPROM base address obtain category information physical address;
First update module 306 include the 24th acquiring unit, the 11st judging unit, the 3rd processing unit, the 4th Processing unit, the 5th processing unit and the tenth updating block;
24th acquiring unit, for obtaining category information physical address when first processing module 304, or first processes list After unit obtains category information physical address, or second processing unit obtains category information physical address, according to category information physical address, JAVA smart cards for storage area obtains current category information;
11st judging unit, for judging the Part I of current category information that the 24th acquiring unit gets Whether data is the second preset value;
When the 11st judging unit, 3rd processing unit, for judging that the data of the Part I of current category information is second During preset value, the data of the Part II according to current category information and ROM base address, obtain the class letter of the parent of current category information The physical address of breath;
When the 11st judging unit, fourth processing unit, for judging that the data of the Part I of current category information is not the During two preset values, the data of the Part II according to current category information and EEPROM base address, obtain the parent of current category information Category information physical address;
5th processing unit, for obtaining the class of the parent of current category information when the 3rd processing unit or fourth processing unit After the physical address of information, the physical address of the category information of the parent according to current category information, in JAVA smart cards for storage area Obtain the data of the Part I of the category information of the parent of current category information, according to the of the data getting and current item data Tetrameric data obtains index value;
Tenth updating block, for after the 5th processing unit obtains index value, using index value as the first parameter, according to First parameter updates the order parameter of the second instruction.
If the current corresponding JAVA of item data instructs as the 3rd instruction, the first judge module 303, specifically for judging the 3rd The reference type of instruction;
First processing module 304, the reference type specifically for judging the 3rd instruction when the first judge module 303 is internal When quoting, the data of the Part I according to current item data obtains the first deviant, according to the first deviant and JAVA intelligence The category information assembly initial address of card storage obtains category information physical address;
Second processing module 305 includes the 25th acquiring unit, the 12nd judging unit, the 6th processing unit and the 7th Processing unit;
25th acquiring unit, for judging that when the first judge module 303 reference type of the 3rd instruction draws for outside Used time, the data of Part II obtaining current item data, as the bag ID of the bag being cited belonging to category information, obtains according to bag ID Take the derivation table address of bag;
12nd judging unit, for judging whether the bag ID that the 25th acquiring unit gets presets less than first Value;
6th processing unit, for when the 12nd judging unit judges that bag ID is less than the first preset value, according to currentitem The derivation table address of the data of the Part III of data and bag, obtains the deviant of category information, according to class in the derived table of bag The deviant of information and ROM base address obtain category information physical address;
7th processing unit, for when the 12nd judging unit judges that bag ID is not less than the first preset value, according to current The derivation table address of the data of the Part III of item data and bag, obtains the deviant of category information in the derived table of bag, according to The deviant of category information and EEPROM base address obtain category information physical address;
First update module 306, specifically for obtaining category information physical address when first processing module 303, or at the 6th After reason unit gets category information physical address, or the 7th processing unit obtains category information physical address, according to category information physics The data of the Part IV of address and current item data obtains the physical address of called method, according to the physics of called method Address obtains the number of parameters of called method in JAVA smart cards for storage area, the number of parameters according to called method and working as The data of the 4th byte of front item data obtains the first parameter, updates the order parameter of the 3rd instruction according to the first parameter.
If the current corresponding JAVA of item data instructs as the 4th instruction, the first judge module 303, specifically for judging the 4th The reference type of instruction;
First processing module 3004, the reference type specifically for judging the 4th instruction when the first judge module 303 is interior When portion quotes, the data of the Part I according to current item data obtains the first deviant, according to the first deviant and JAVA intelligence The category information assembly initial address that storage can be blocked obtains category information physical address;
Second processing module 305 includes the 26th acquiring unit, the 13rd judging unit, the 8th processing unit and the 9th Processing unit;
26th acquiring unit, for judging that when the first judge module 303 reference type of the 4th instruction draws for outside Used time, the data of Part II obtaining current item data, as the bag ID of the bag being cited belonging to category information, obtains according to bag ID Take the derivation table address of bag;
13rd judging unit, for judging whether the bag ID that the 26th acquiring unit gets presets less than first Value;
8th processing unit, for when the 13rd judging unit judges that bag ID is less than the first preset value, according to currentitem The derivation table address of the data of the Part III of data and bag, obtains the deviant of category information, according to class in the derived table of bag The deviant of information and ROM base address obtain category information physical address, and update the order code of the 4th instruction;
9th processing unit, for when the 13rd judging unit judges that bag ID is not less than the first preset value, according to current The derivation table address of the data of the Part III of item data and bag, obtains the deviant of category information in the derived table of bag, according to The deviant of category information and EEPROM base address obtain category information physical address;
First update module 306, specifically for obtaining category information physical address when first processing module 303, or at the 8th After reason unit gets category information physical address, or the 9th processing unit gets category information physical address, according to category information thing The data of the Part IV of reason address and current item data obtains the offset address of called method, by the skew of called method Address, as the first parameter, updates the order parameter of the 4th instruction according to the first parameter.
If the current corresponding JAVA of item data instructs as the 5th instruction, the first judge module 303, specifically for judging the 5th The reference type of instruction;
First processing module 304, the reference type specifically for judging the 5th instruction when the first judge module 303 is internal When quoting, the data of the Part V according to current item data obtains the second deviant, according to the second deviant and JAVA intelligence The static fields assembly initial address of card storage obtains static fields physical address, according to static fields physical address and EEPROM base address Obtain the offset address of accessed static fields;
Second processing module 305, the reference type specifically for judging the 5th instruction when the first judge module 303 is outside When quoting, obtain current item data Part II data as the bag being cited belonging to category information bag ID, according to bag ID Obtain the derivation table address of bag, the derivation table address of the data of the Part I according to current item data and bag, in derived table Obtain the offset address of accessed static fields;
First update module 306, specifically for obtaining the offset address of accessed static fields when first processing module 304, Or after Second processing module 305 obtains the offset address of accessed static fields, using the offset address of accessed static fields as the One parameter, updates the order parameter of the 5th instruction according to the first parameter.
If the current corresponding JAVA of item data instructs as the 6th instruction, the first judge module 303, specifically for judging the 6th The reference type of instruction;
First processing module 304, the reference type specifically for judging the 6th instruction when the first judge module 303 is internal When quoting, the data of the Part V according to current item data obtains the second deviant, according to the second deviant and JAVA intelligence The method assembly initial address of card storage obtains method physical address, according to method physical address and the EEPROM base address side of obtaining The deviant of method;
Second processing module 305 includes the 27th acquiring unit, the 14th judging unit, the 11st updating block and 28 acquiring units;
27th acquiring unit, for judging that when the first judge module 303 reference type of the 6th instruction draws for outside Used time, obtain current item data Part II data as the bag belonging to called method bag ID;
14th judging unit, for judging whether the bag ID that the 27th acquiring unit gets presets less than first Value;
11st updating block, for when the 14th judging unit judges that bag ID is less than the first preset value, updating the 6th The order code of instruction;
28th acquiring unit, for judging that bag ID is not less than the first preset value when the 13rd judging unit, or the tenth After one updating block updates the order code of the 6th instruction, obtain the derivation table address of bag according to bag ID, according to current item data The derivation table address of the data of Part V and bag, the deviant of acquisition methods in the derived table of bag;
First update module 306, specifically for obtaining the deviant of method when first processing module 304, or the 28th After acquiring unit gets the deviant of method, using the deviant of method as the first parameter, update the 6th according to the first parameter The order parameter of instruction.
The above, the only present invention preferably specific embodiment, but protection scope of the present invention is not limited thereto, Any those familiar with the art in technical scope disclosed by the invention, the change or replacement that can readily occur in, All should be included within the scope of the present invention.Therefore, protection scope of the present invention should be with scope of the claims It is defined.

Claims (26)

1. a kind of method of efficient renewal JAVA instruction is it is characterised in that methods described includes:
Step S1:JAVA smart card obtains the correction data of relative address assembly from Application Protocol Data Unit, according to described Revise data and obtain the index value in constant pool component from JAVA smart cards for storage area;
Step S2:Described JAVA smart card is according to the index value in the described constant pool component getting in described constant pool component The current item data of middle acquisition, judges whether to get current item data, is then execution step S3, otherwise return error message, ties Bundle;
Step S3:According to the 1st byte of current item data, described JAVA smart card judges that the corresponding JAVA of current item data refers to The reference type of order, if internal reference then execution step S4, if external reference then execution step S5;
Step S4:Described JAVA smart card obtains deviant according to the first predetermined fraction of current item data, according to described skew Value and described JAVA instruct corresponding assembly initial address and obtain the first parameter, execution step S6;
Step S5:Described JAVA smart card obtains the derivation table address wrapping according to the second predetermined fraction of current item data, according to The table address of deriving of current item data and described bag obtains the first parameter, execution step S6 in the derived table of bag;
Step S6:Described JAVA smart card updates the order parameter of described JAVA instruction according to described first parameter, terminates.
2. method according to claim 1 is it is characterised in that include before described step S1:
Step S0-1:Described JAVA smart card obtains described phase according to reading address from the Application Protocol Data Unit receiving Close address components in correction data length data as untreatment data length, according to the described length data getting Length updates described reading address;The initial value of described reading address is the length of the correction data in described relative address assembly The first address of data;
Step S0-2:Described JAVA smart card judges whether untreated correction number according to described untreatment data length According to being then execution step S1, otherwise return success, terminate;
Described step S1 is specially:Described JAVA smart card obtains from described Application Protocol Data Unit according to described reading address Take the correction data of described relative address assembly, constant pool group is obtained from JAVA smart cards for storage area according to described correction data Index value in part, according to the correction data of the described relative address assembly reading, update described untreatment data length and Described reading address;
Include after described step S6:
Step S7:Described JAVA smart card judges the described relative address assembly in this Application Protocol Data Unit receiving Data whether treated complete, be to return success, wait and receive the next one and comprise described relative address assembly Data Application Protocol Data Unit, return to step S0-2, otherwise return to step S0-2.
3. method according to claim 2 is it is characterised in that the length of described correction data in described relative address assembly Degrees of data includes the length data of single byte correction data and the length data of double byte correction data;
Described step S0-1 is specially to step S1:
Step s1-1:Described JAVA smart card obtains described phase according to reading address from the Application Protocol Data Unit receiving Close address components in single byte correction data length data as the first untreatment data length, according to get The length of length data updates described reading address;The initial value of described reading address is the individual character in described relative address assembly Section revises the first address of the length data of data;
Step s1-2:Described JAVA smart card judges whether untreated individual character according to described first untreatment data length Section revises data, is then execution step s1-3, otherwise execution step s1-6;
Step s1-3:Described JAVA smart card obtains described phase according to described reading address from described Application Protocol Data Unit The data closing 1 byte of address components revises data as first, according to the number in the described relative address assembly reading According to updating described first untreatment data length and described reading address;
Step s1-4:Described JAVA smart card updates according to the described first correction data and is relocated the first of data physically Location;The initial value of described the first physical address being relocated data is the method assembly base of described JAVA smart cards for storage Location;
Step s1-5:Described JAVA smart card is according to described the first physical address being relocated data from described JAVA smart card The data of 1 byte is obtained as the index value in constant pool component, execution step S2 in memory block;
Step s1-6:Described JAVA smart card judges whether to obtain the length data of double byte correction data as at second Reason data length, be then execution step s1-7, and otherwise described JAVA smart card receives from described according to described reading address The length data of double byte correction data obtaining described relative address assembly in Application Protocol Data Unit is as at second Reason data length, the length according to the described length data getting updates described reading address, execution step s1-7;
Step s1-7:Described JAVA smart card judges whether untreated double word according to described second untreatment data length Section revises data, is then execution step s1-8, otherwise returns success, and terminates;
Step s1-8:Described JAVA smart card obtains described phase according to described reading address from described Application Protocol Data Unit The data of 1 byte closing address components is as the second correction data;According to the number in the described relative address assembly reading According to updating described second untreatment data length and described reading address;
Step s1-9:Described JAVA smart card updates according to the described second correction data and is relocated the second of data physically Location;The initial value of described the second physical address being relocated data is the method assembly base of described JAVA smart cards for storage Location;
Step s1-10:Described JAVA smart card is according to described the second physical address being relocated data from described JAVA intelligence The data of 2 bytes is obtained as the index value in constant pool component, execution step S2 in card memory area.
4. method according to claim 2 is it is characterised in that the length of described correction data in described relative address assembly Degrees of data includes the length data of single byte correction data and the length data of double byte correction data;
Described step S0-1 is specially to step S1:
Step s2-1:Described JAVA smart card obtains described phase according to reading address from the Application Protocol Data Unit receiving Close address components in double byte correction data length data as the first untreatment data length, according to get The length of length data updates described reading address;The initial value of described reading address is the double word in described relative address assembly Section revises the first address of the length data of data;
Step s2-2:Described JAVA smart card judges whether untreated double word according to described first untreatment data length Section revises data, is then execution step s2-3, otherwise execution step s2-6;
Step s2-3:Described JAVA smart card obtains described phase according to described reading address from described Application Protocol Data Unit The data closing 1 byte of address components revises data as first, according to the number in the described relative address assembly reading According to updating described first untreatment data length and described reading address;
Step s2-4:Described JAVA smart card updates according to the described first correction data and is relocated the first of data physically Location;The initial value of described the first physical address being relocated data is the method assembly base of described JAVA smart cards for storage Location;
Step s2-5:Described JAVA smart card is according to described the first physical address being relocated data from described JAVA smart card The data of 2 bytes is obtained as the index value in constant pool component, execution step S2 in memory block;
Step s2-6:Described JAVA smart card judges whether to obtain the length data of single byte correction data as at second Reason data length, be then execution step s2-7, and otherwise described JAVA smart card receives from described according to described reading address The length data of single byte correction data obtaining described relative address assembly in Application Protocol Data Unit is as at second Reason data length, the length according to the described length data getting updates described reading address, execution step s2-7;
Step s2-7:Described JAVA smart card judges whether untreated individual character according to described second untreatment data length Section revises data, is then execution step s2-8, otherwise returns success, and terminates;
Step s2-8:Described JAVA smart card obtains described phase according to described reading address from described Application Protocol Data Unit The data of 1 byte closing address components is as the second correction data;According to the number in the described relative address assembly reading According to updating described second untreatment data length and described reading address;
Step s2-9:Described JAVA smart card updates according to the described second correction data and is relocated the second of data physically Location;The initial value of described the second physical address being relocated data is the method assembly base of described JAVA smart cards for storage Location;
Step s2-10:Described JAVA smart card is according to described the second physical address being relocated data from described JAVA intelligence The data of 1 byte is obtained as the index value in constant pool component, execution step S2 in card memory area.
5. method according to claim 2 is it is characterised in that the length of described correction data in described relative address assembly Degrees of data includes the length data of single byte correction data and the length data of double byte correction data;
Described step S0-1 is specially to step S1:
Step s3-1:Described JAVA smart card obtains described phase according to reading address from the Application Protocol Data Unit receiving The length data of the single byte correction data in the address components of pass, as the first untreatment data length, obtains described relative address The length data of the double byte correction data in assembly as the second untreatment data length, according to the described length number getting According to length update described reading address;The initial value of described reading address is the single byte correction in described relative address assembly The first address of the length data of data;
Step s3-2:Described JAVA smart card judges whether untreated individual character according to described first untreatment data length Section revises data, is then execution step s3-3, otherwise execution step s3-6;
Step s3-3:Described JAVA smart card obtains described phase according to described reading address from described Application Protocol Data Unit The data closing 1 byte of address components revises data as first, according to the number in the described relative address assembly reading According to updating described first untreatment data length and described reading address;
Step s3-4:Described JAVA smart card updates according to the described first correction data and is relocated the first of data physically Location;The initial value of described the first physical address being relocated data is the method assembly base of described JAVA smart cards for storage Location;
Step s3-5:Described JAVA smart card is according to described the first physical address being relocated data from described JAVA smart card The data of 1 byte is obtained as the index value in constant pool component, execution step S2 in memory block;
Step s3-6:Described JAVA smart card judges whether untreated double word according to described second untreatment data length Section revises data, is then execution step s3-7, otherwise returns success, and terminates;
Step s3-7:Described JAVA smart card obtains described phase according to described reading address from described Application Protocol Data Unit The data of 1 byte closing address components is as the second correction data;According to the number in the described relative address assembly reading According to updating described second untreatment data length and described reading address;
Step s3-8:Described JAVA smart card updates according to the described second correction data and is relocated the second of data physically Location;The initial value of described the second physical address being relocated data is the method assembly base of described JAVA smart cards for storage Location;
Step s3-9:Described JAVA smart card is according to described the second physical address being relocated data from described JAVA smart card The data of 2 bytes is obtained as the index value in constant pool component, execution step S2 in memory block.
6. method according to claim 2 is it is characterised in that the length of described correction data in described relative address assembly Degrees of data includes the length data of single byte correction data and the length data of double byte correction data;
Described step S0-1 is specially to step S1:
Step s4-1:Described JAVA smart card obtains described phase according to reading address from the Application Protocol Data Unit receiving The length data of the double byte correction data in the address components of pass, as the first untreatment data length, obtains described relative address The length data of the single byte correction data in assembly as the second untreatment data length, according to the described length number getting According to length update described reading address;The initial value of described reading address is the double byte correction in described relative address assembly The first address of the length data of data;
Step s4-2:Described JAVA smart card judges whether untreated double word according to described first untreatment data length Section revises data, is then execution step s4-3, otherwise execution step s4-6;
Step s4-3:Described JAVA smart card obtains described phase according to described reading address from described Application Protocol Data Unit The data closing 1 byte of address components revises data as first, according to the number in the described relative address assembly reading According to updating described first untreatment data length and described reading address;
Step s4-4:Described JAVA smart card updates according to the described first correction data and is relocated the first of data physically Location;The initial value of described the first physical address being relocated data is the method assembly base of described JAVA smart cards for storage Location;
Step s4-5:Described JAVA smart card is according to described the first physical address being relocated data from described JAVA smart card The data of 2 bytes is obtained as the index value in constant pool component, execution step S2 in memory block;
Step s4-6:Described JAVA smart card judges whether untreated individual character according to described second untreatment data length Section revises data, is then execution step s4-7, otherwise returns success, and terminates;
Step s4-7:Described JAVA smart card obtains described phase according to described reading address from described Application Protocol Data Unit The data of 1 byte closing address components is as the second correction data;According to the number in the described relative address assembly reading According to updating described second untreatment data length and described reading address;
Step s4-8:Described JAVA smart card updates according to the described second correction data and is relocated the second of data physically Location;The initial value of described the second physical address being relocated data is the method assembly base of described JAVA smart cards for storage Location;
Step s4-9:Described JAVA smart card is according to described the second physical address being relocated data from described JAVA smart card The data of 1 byte is obtained as the index value in constant pool component, execution step S2 in memory block.
7. method according to claim 1 is it is characterised in that include before described step S1:
Step S0-1 ':Described JAVA smart card is according to read address and obtain from the Application Protocol Data Unit receiving The length data of the correction data in relative address assembly as untreatment data length, according to the described length data getting Length update described reading address;The initial value of described reading address is the length of the correction data in described relative address assembly The first address of degrees of data, execution step S1;
Described step S1 is specially:Described JAVA smart card obtains from described Application Protocol Data Unit according to described reading address Take the correction data of described relative address assembly, constant pool group is obtained from JAVA smart cards for storage area according to described correction data Index value in part, according to the correction data of the described relative address assembly reading, update described untreatment data length and Described reading address;
Include after described step S6:
Step S8:Described JAVA smart card judges whether to have processed all data in described relative address assembly, is to return Successful information, terminates, otherwise execution step S9;
Step S9:Described JAVA smart card judges the described relative address assembly in this Application Protocol Data Unit receiving Data whether treated complete, be to return success, wait and receive the next one and comprise described relative address assembly Data Application Protocol Data Unit, return to step S1, otherwise return to step S1.
If 8. method according to claim 1 is it is characterised in that the current corresponding JAVA of item data instructs as the first finger Order, described step S3 is specially to step S6:
Step A1:Described JAVA smart card judges the reference type of described first instruction, if internal reference then execution step A2, If external reference then execution step A3;
Step A2:The data of the Part I according to current item data for the described JAVA smart card obtains the first deviant, according to institute State the first deviant and the category information assembly initial address of described JAVA smart cards for storage obtains category information physical address, according to institute State category information physical address and EEPROM base address obtains the deviant of category information, execution step A7;
Step A3:Described JAVA smart card obtains the data of the Part II of current item data as being cited belonging to category information The bag ID of bag;
Step A4:Described JAVA smart card judges that whether described bag ID is less than the first preset value, is then execution step A5, otherwise holds Row step A6;
Step A5:Described JAVA smart card updates the order code of described first instruction, execution step A6;
Step A6:Described JAVA smart card obtains the derivation table address of bag according to described bag ID, according to the 3rd of current item data the The derivation table address of partial data and described bag, obtains the deviant of category information, execution step A7 in the derived table of bag;
Step A7:The deviant of described category information as described first parameter, is joined by described JAVA smart card according to described first Number updates the order parameter of described first instruction.
If 9. method according to claim 1 is it is characterised in that the current corresponding JAVA of item data instructs as the second finger Order, described step S3 is specially to step S6:
Step B1:Described JAVA smart card judges the reference type of described second instruction, if internal reference then execution step B2, If external reference then execution step B3;
Step B2:The data of the Part I according to current item data for the described JAVA smart card obtains the first deviant, according to institute State the first deviant and the category information assembly initial address of described JAVA smart cards for storage obtains category information physical address, execute step Rapid B7;
Step B3:Described JAVA smart card obtains the data of the Part II of current item data as being cited belonging to category information The bag ID of bag, obtains the derivation table address of bag according to described bag ID;
Step B4:Described JAVA smart card judges that whether described bag ID is less than the first preset value, is then execution step B5, otherwise holds Row step B6;
Step B5:The data of Part III according to current item data for the described JAVA smart card and the derivation table address of described bag, Obtain the deviant of category information in the derived table of bag, the deviant according to described category information and ROM base address obtain category information Physical address, execution step B7;
Step B6:The data of Part III according to current item data for the described JAVA smart card and the derivation table address of described bag, Obtain the deviant of category information in the derived table of bag, the deviant according to described category information and EEPROM base address obtain class letter Breath physical address, execution step B7;
Step B7:Described JAVA smart card, according to described category information physical address, obtains in described JAVA smart cards for storage area and works as Front category information;
Step B8:Described JAVA smart card judges whether the data of the Part I of current category information is the second preset value, is then Execution step B9, otherwise execution step B10;
Step B9:The data of Part II according to current category information for the described JAVA smart card and ROM base address, obtain current class The physical address of the category information of the parent of information, execution step B11;
Step B10:The data of Part II according to current category information for the described JAVA smart card and EEPROM base address, are worked as The physical address of the category information of the parent of front category information, execution step B11;
Step B11:The physical address of the category information of the parent according to described current category information for the described JAVA smart card, described The data of the Part I of the category information of parent of current category information is obtained, according to the number getting in JAVA smart cards for storage area Obtain index value according to the data with the Part IV of current item data;
Step B12:Described index value as described first parameter, is updated institute according to described first parameter by described JAVA smart card State the order parameter of the second instruction.
If 10. method according to claim 1 is it is characterised in that the current corresponding JAVA of item data instructs as the 3rd finger Order, described step S3 is specially to step S6:
Step C1:Described JAVA smart card judges the reference type of described 3rd instruction, if internal reference then execution step C2, If external reference then execution step C3;
Step C2:The data of the Part I according to current item data for the described JAVA smart card obtains the first deviant, according to institute State the first deviant and the category information assembly initial address of described JAVA smart cards for storage obtains category information physical address, execute step Rapid C7;
Step C3:Described JAVA smart card obtains the data of the Part II of current item data as being cited belonging to category information The bag ID of bag, obtains the derivation table address of bag according to described bag ID;
Step C4:Smart card described in described JAVA judges that whether described bag ID is less than the first preset value, is then execution step C5, no Then execution step C6;
Step C5:The data of Part III according to current item data for the described JAVA smart card and the derivation table address of described bag, Obtain the deviant of category information in the derived table of bag, the deviant according to described category information and ROM base address obtain category information Physical address, execution step C7;
Step C6:The data of Part III according to current item data for the described JAVA smart card and the derivation table address of described bag, Obtain the deviant of category information in the derived table of bag, the deviant according to described category information and EEPROM base address obtain class letter Breath physical address, execution step C7;
Step C7:JAVA smart card according to the data of described category information physical address and the Part IV of current item data obtain by The physical address of call method, the physical address according to described called method obtains called in JAVA smart cards for storage area The number of parameters of method, the data of the Part IV of the number of parameters according to called method and current item data obtains the first ginseng Number, updates the order parameter of described 3rd instruction according to described first parameter.
If 11. methods according to claim 1 are it is characterised in that the current corresponding JAVA of item data instructs as the 4th finger Order, described step S3 is specially to step S6:
Step D1:Described JAVA smart card judges the reference type of described 4th instruction, if internal reference then execution step D2, If external reference then execution step D3;
Step D2:The data of the Part I according to current item data for the described JAVA smart card obtains the first deviant, according to institute State the first deviant and the category information assembly initial address of described JAVA smart cards for storage obtains category information physical address, execute step Rapid D7;
Step D3:Described JAVA smart card obtains the data of the Part II of current item data as being cited belonging to category information The bag ID of bag, obtains the derivation table address of bag according to described bag ID;
Step D4:Described JAVA smart card judges that whether described bag ID is less than the first preset value, is then execution step D5, otherwise holds Row step D6;
Step D5:The data of Part III according to current item data for the described JAVA smart card and the derivation table address of described bag, Obtain the deviant of category information in the derived table of bag, the deviant according to described category information and ROM base address obtain category information Physical address, and update the order code of the 4th instruction, execution step D7;
Step D6:The data of Part III according to current item data for the described JAVA smart card and the derivation table address of described bag, Obtain the deviant of category information in the derived table of bag, the deviant according to described category information and EEPROM base address obtain class letter Breath physical address, execution step D7;
Step D7:Described JAVA smart card obtains according to the data of described category information physical address and the Part IV of current item data To the offset address of called method, using the offset address of described called method as the first parameter, according to the described first ginseng Number updates the order parameter of described 4th instruction.
If 12. methods according to claim 1 are it is characterised in that the current corresponding JAVA of item data instructs as the five fingers Order, described step S3 is specially to step S6:
Step E1:Described JAVA smart card judges the reference type of described 5th instruction, if internal reference then execution step E2, If external reference then execution step E3;
Step E2:The data of the Part V according to current item data for the described JAVA smart card obtains the second deviant, according to institute State the second deviant and the static fields assembly initial address of described JAVA smart cards for storage obtains static fields physical address, according to institute State static fields physical address and EEPROM base address obtains the offset address of accessed static fields, execution step E4;
Step E3:Described JAVA smart card obtains the data of the Part II of current item data as being cited belonging to category information The bag ID of bag, obtains the derivation table address wrapping, the data of the Part I according to current item data and described according to described bag ID The derivation table address of bag, obtains the offset address of accessed static fields, execution step E4 in derived table;
Step E4:Described JAVA smart card using the offset address of described accessed static fields as described first parameter, according to institute State the order parameter that the first parameter updates described 5th instruction.
If 13. methods according to claim 1 are it is characterised in that the current corresponding JAVA of item data instructs as the 6th finger Order, described step S3 is specially to step S6:
Step F1:Described JAVA smart card judges the reference type of described 6th instruction, if internal reference then execution step F2, If external reference then execution step F3;
Step F2:The data of the Part V according to current item data for the described JAVA smart card obtains the second deviant, according to institute State the second deviant and the method assembly initial address of described JAVA smart cards for storage obtains method physical address, according to described side Method physical address and EEPROM base address obtain the deviant of method, execution step F7;
Step F3:Described JAVA smart card obtains the data of the Part II of current item data as the bag belonging to called method Bag ID;
Step F4:Described JAVA smart card judges that whether described bag ID is less than the first preset value, is then execution step F5, otherwise holds Row step F6;
Step F5:Described JAVA smart card updates the order code of the 6th instruction, execution step F6;
Step F6:Described JAVA smart card obtains the derivation table address of bag according to described bag ID, according to the 5th of current item data the The derivation table address of partial data and described bag, the deviant of acquisition methods in the derived table of bag;
Step F7:The deviant of methods described as the first parameter, is updated by described JAVA smart card according to described first parameter The order parameter of described 6th instruction.
A kind of 14. devices of efficient renewal JAVA instruction are it is characterised in that described device includes:First acquisition module, second obtain Delivery block, the first judge module, first processing module, Second processing module, the first update module and output module;
Described first acquisition module, for obtaining the correction data of relative address assembly from Application Protocol Data Unit, according to Described correction data obtains the index value in constant pool component from JAVA smart cards for storage area;
Described second acquisition module, for the index value in the described constant pool component that got according to described first acquisition module Obtain current item data in described constant pool component, judge whether to get current item data;
Described first judge module, for when described second acquisition module gets current item data, according to current item data The 1st byte judge current item data corresponding JAVA instruction reference type;
Described first processing module, for judging quoting of current item data corresponding JAVA instruction when described first judge module When type is internal reference, deviant is obtained according to the first predetermined fraction of current item data, according to described deviant and described JAVA instructs corresponding assembly initial address and obtains the first parameter;
Described Second processing module, for judging quoting of current item data corresponding JAVA instruction when described first judge module When type is external reference, obtain the derivation table address wrapping according to the second predetermined fraction of current item data, according to current item number Obtain the first parameter according to the table address of deriving with described bag in the derived table of bag;
Described first update module, for after described first processing module obtains the first parameter, according to described first parameter more The newly order parameter of described JAVA instruction;After described Second processing module obtains the first parameter, according to described first parameter more The newly order parameter of described JAVA instruction;
Described output module, for when described second acquisition module does not get current item data, returning error message.
15. devices according to claim 14 are it is characterised in that described device also includes:3rd acquisition module and second Judge module;
Described 3rd acquisition module, for obtaining described correlation according to reading address from the Application Protocol Data Unit receiving The length data of the correction data in address components as untreatment data length, according to the length of the described length data getting Degree updates described reading address;The initial value of described reading address is the length number of the correction data in described relative address assembly According to first address;
Described second judge module, the described untreatment data length for being got according to described 3rd acquisition module judge be No have untreated correction data;
Described output module, is additionally operable to, when described second judge module judges not existing untreated correction data, return into Work(information;
Described first acquisition module, described in obtaining from described Application Protocol Data Unit according to described reading address The correction data of relative address assembly, obtains in constant pool component from JAVA smart cards for storage area according to described correction data Index value, according to the correction data of the described relative address assembly reading, updates described untreatment data length and described reading Take address;
Described device also includes the 3rd judge module and receiver module;
Described 3rd judge module, for, after described first update module updates the order parameter that described JAVA instructs, judging Whether the data of the described relative address assembly in this Application Protocol Data Unit receiving is treated to complete;
Described output module, is additionally operable to judge in this Application Protocol Data Unit receiving when described 3rd judge module Data is treated when completing, and returns success;
Described receiver module, for judging the number in this Application Protocol Data Unit receiving when described 3rd judge module During according to treated completing, wait and receive the application protocol data list of the data that the next one comprises described relative address assembly Unit.
16. devices according to claim 15 it is characterised in that described 3rd acquisition module include first acquisition unit and Second acquisition unit;
Described first acquisition unit, for obtaining described correlation according to reading address from the Application Protocol Data Unit receiving The length data of the single byte correction data in address components as the first untreatment data length, according to the described length getting The length of degrees of data updates described reading address;The initial value of described reading address is the single byte in described relative address assembly Revise the first address of the length data of data;
When the 4th judge module, described second acquisition unit, for judging that the length data not getting double byte correction data is made During for the second untreatment data length, institute is obtained from the described Application Protocol Data Unit receiving according to described reading address The length data of double byte correction data stating relative address assembly as the second untreatment data length, according to the institute getting The length stating length data updates described reading address;
Described second judge module includes the first judging unit and the second judging unit;
Described first judging unit, for after described first acquisition unit gets described first untreatment data length, root Judge whether untreated single byte correction data according to described first untreatment data length;
Described second judging unit, for judging to have got the length number of double byte correction data when described 4th judge module During according to getting described second untreatment data length as the second untreatment data length or described second acquisition unit, according to Described second untreatment data length judges whether untreated double byte correction data;
Described output module, is additionally operable to when described second judging unit judges there is not untreated double byte correction data, Return success;
Described first acquisition module includes the 3rd acquiring unit, the first updating block and the 4th acquiring unit;
Described 3rd acquiring unit, for when described first judging unit judge there is untreated single byte correction data when, The data obtaining 1 byte of described relative address assembly according to described reading address from described Application Protocol Data Unit is made For the first correction data, according to the data in the described relative address assembly reading, update described first untreatment data long Degree and described reading address;
Described first updating block, the described first correction data for being got according to described 3rd acquiring unit updates and is weighed First physical address of location data;The initial value of described the first physical address being relocated data is described JAVA smart card The method assembly base address of storage;
Described 4th acquiring unit, for according to described first updating block update obtain described in be relocated the first of data Physical address obtains the data of 1 byte as the index value in constant pool component from described JAVA smart cards for storage area;
Described device includes described 4th judge module, for judging there is not untreated individual character when described first judging unit When section revises data, judge whether to get the length data of double byte correction data as the second untreatment data length;
Described first acquisition module includes the 5th acquiring unit, the second updating block and the 6th acquiring unit;
Described 5th acquiring unit, for when described second judging unit judge there is untreated double byte correction data when, The data obtaining 1 byte of described relative address assembly according to described reading address from described Application Protocol Data Unit is made For the second correction data, according to the data in the described relative address assembly reading, update described second untreatment data long Degree and described reading address;
Described second updating block, the described second correction data for being got according to described 5th acquiring unit updates and is weighed Second physical address of location data;The initial value of described the second physical address being relocated data is described JAVA smart card The method assembly base address of storage;
Described 6th acquiring unit, for according to described second updating block update obtain described in be relocated the second of data Physical address obtains the data of 2 bytes as the index value in constant pool component from described JAVA smart cards for storage area.
17. devices according to claim 15 it is characterised in that described 3rd acquisition module include the 7th acquiring unit and 8th acquiring unit;
Described 7th acquiring unit, for obtaining described correlation according to reading address from the Application Protocol Data Unit receiving The length data of the double byte correction data in address components as the first untreatment data length, according to the described length getting The length of degrees of data updates described reading address;The initial value of described reading address is the double byte in described relative address assembly Revise the first address of the length data of data;
When the 5th judge module, described 8th acquiring unit, for judging that the length data not getting single byte correction data is made During for the second untreatment data length, institute is obtained from the described Application Protocol Data Unit receiving according to described reading address The length data of single byte correction data stating relative address assembly as the second untreatment data length, according to the institute getting The length stating length data updates described reading address;
Described second judge module includes the 3rd judging unit and the 4th judging unit;
Described 3rd judging unit, for after described 7th acquiring unit gets described first untreatment data length, root Judge whether untreated double byte correction data according to described first untreatment data length;
Described 4th judging unit, for judging to have got the length number of single byte correction data when described 5th judge module During according to getting described second untreatment data length as the second untreatment data length or described 8th acquiring unit, according to Described second untreatment data length judges whether untreated single byte correction data;
Described output module, is additionally operable to when described 4th judging unit judges there is not untreated single byte correction data, Return success;
Described first acquisition module includes the 9th acquiring unit, the 3rd updating block and the tenth acquiring unit;
Described 9th acquiring unit, for when described 3rd judging unit judge there is untreated double byte correction data when, The data obtaining 1 byte of described relative address assembly according to described reading address from described Application Protocol Data Unit is made For the first correction data, according to the data in the described relative address assembly reading, update described first untreatment data long Degree and described reading address;
Described 3rd updating block, the described first correction data for being got according to described 9th acquiring unit updates and is weighed First physical address of location data;The initial value of described the first physical address being relocated data is described JAVA smart card The method assembly base address of storage;
Described tenth acquiring unit, for according to described 3rd updating block update obtain described in be relocated the first of data Physical address obtains the data of 2 bytes as the index value in constant pool component from described JAVA smart cards for storage area;
Described device includes described 5th judge module, for judging there is not untreated double word when described 3rd judging unit When section revises data, judge whether to get the length data of single byte correction data as the second untreatment data length;
Described first acquisition module includes the 11st acquiring unit, the 4th updating block and the 12nd acquiring unit;
Described 11st acquiring unit, for judging there is untreated single byte correction data when described 4th judging unit When, the number of 1 byte of described relative address assembly is obtained from described Application Protocol Data Unit according to described reading address According to as the second correction data, according to the data in the described relative address assembly reading, update the described second untreated number According to length and described reading address;
Described 4th updating block, described second for being got according to described 11st acquiring unit is revised data and updates quilt Second physical address of reorientation data;The initial value of described the second physical address being relocated data is described JAVA intelligence The method assembly base address of card storage;
Described 12nd acquiring unit, for according to described 4th updating block update obtain described in be relocated the of data Two physical address obtain the data of 1 byte as the index value in constant pool component from described JAVA smart cards for storage area.
18. devices according to claim 15 are it is characterised in that described 3rd acquisition module is specifically for according to reading Address obtains the length of the single byte correction data in described relative address assembly from the Application Protocol Data Unit receiving Data is made as the first untreatment data length, the length data obtaining the double byte correction data in described relative address assembly For the second untreatment data length, the length according to the described length data getting updates described reading address;Described reading The initial value of address is the first address of the length data of single byte correction data in described relative address assembly;
Described second judge module includes the 5th judging unit and the 6th judging unit;
Described 5th judging unit, for after described 3rd acquisition module gets described first untreatment data length, root Judge whether untreated single byte correction data according to described first untreatment data length;
Described 6th judging unit, for judging there is not untreated single byte correction data when described 5th judging unit When, untreated double word is judged whether according to the described second untreatment data length that described 3rd acquisition module gets Section revises data;
Described output module, is additionally operable to when described 6th judging unit judges there is not untreated double byte correction data, Return success;
Described first acquisition module includes the 13rd acquiring unit, the 5th updating block and the 14th acquiring unit;
Described 13rd acquiring unit, for judging there is untreated single byte correction data when described 5th judging unit When, the number of 1 byte of described relative address assembly is obtained from described Application Protocol Data Unit according to described reading address According to as the first correction data, according to the data in the described relative address assembly reading, update the described first untreated number According to length and described reading address;
Described 5th updating block, described first for being got according to described 13rd acquiring unit is revised data and updates quilt First physical address of reorientation data;The initial value of described the first physical address being relocated data is described JAVA intelligence The method assembly base address of card storage;
Described 14th acquiring unit, for according to described 5th updating block update obtain described in be relocated the of data One physical address obtains the data of 1 byte as the index value in constant pool component from described JAVA smart cards for storage area;
Described first acquisition module includes the 15th acquiring unit, the 6th updating block and the 16th acquiring unit;
Described 15th acquiring unit, for judging there is untreated double byte correction data when described 6th judging unit When, the number of 1 byte of described relative address assembly is obtained from described Application Protocol Data Unit according to described reading address According to as the second correction data, according to the data in the described relative address assembly reading, update the described second untreated number According to length and described reading address;
Described 6th updating block, described second for being got according to described 15th acquiring unit is revised data and updates quilt Second physical address of reorientation data;The initial value of described the second physical address being relocated data is described JAVA intelligence The method assembly base address of card storage;
Described 16th acquiring unit, for according to described 6th updating block update obtain described in be relocated the of data Two physical address obtain the data of 2 bytes as the index value in constant pool component from described JAVA smart cards for storage area.
19. devices according to claim 15 are it is characterised in that described 3rd acquisition module is specifically for according to reading Address obtains the length of the double byte correction data in described relative address assembly from the Application Protocol Data Unit receiving Data is made as the first untreatment data length, the length data obtaining the single byte correction data in described relative address assembly For the second untreatment data length, the length according to the described length data getting updates described reading address;Described reading The initial value of address is the first address of the length data of double byte correction data in described relative address assembly;
Described second judge module includes the 7th judging unit and the 8th judging unit;
Described 7th judging unit, for after described 3rd acquisition module gets described first untreatment data length, root Judge whether untreated double byte correction data according to described first untreatment data length;
Described 8th judging unit, for judging there is not untreated double byte correction data when described 7th judging unit When, untreated individual character is judged whether according to the described second untreatment data length that described 3rd acquisition module gets Section revises data;
Described output module, is additionally operable to when described 8th judging unit judges there is not untreated single byte correction data, Return success;
Described first acquisition module includes the 17th acquiring unit, the 7th updating block and the 18th acquiring unit;
Described 17th acquiring unit, for judging there is untreated double byte correction data when described 7th judging unit When, the number of 1 byte of described relative address assembly is obtained from described Application Protocol Data Unit according to described reading address According to as the first correction data, according to the data in the described relative address assembly reading, update the described first untreated number According to length and described reading address;
Described 7th updating block, described first for being got according to described 17th acquiring unit is revised data and updates quilt First physical address of reorientation data;The initial value of described the first physical address being relocated data is described JAVA intelligence The method assembly base address of card storage;
Described 18th acquiring unit, for according to described 7th updating block update obtain described in be relocated the of data One physical address obtains the data of 2 bytes as the index value in constant pool component from described JAVA smart cards for storage area;
Described first acquisition module includes the 19th acquiring unit, the 8th updating block and the 20th acquiring unit;
Described 19th acquiring unit, for judging there is untreated single byte correction data when described 8th judging unit When, the number of 1 byte of described relative address assembly is obtained from described Application Protocol Data Unit according to described reading address According to as the second correction data, according to the data in the described relative address assembly reading, update the described second untreated number According to length and described reading address;
Described 8th updating block, described second for being got according to described 19th acquiring unit is revised data and updates quilt Second physical address of reorientation data;The initial value of described the second physical address being relocated data is described JAVA intelligence The method assembly base address of card storage;
Described 20th acquiring unit, for according to described 8th updating block update obtain described in be relocated the of data Two physical address obtain the data of 1 byte as the index value in constant pool component from described JAVA smart cards for storage area.
20. devices according to claim 14 are it is characterised in that described device includes the 4th acquisition module, the 6th judgement Module, the 7th judge module and receiver module;
Described 4th acquisition module, for obtaining described correlation according to reading address from the Application Protocol Data Unit receiving The length data of the correction data in address components as untreatment data length, according to the length of the described length data getting Degree updates described reading address;The initial value of described reading address is the length number of the correction data in described relative address assembly According to first address;
Described first acquisition module, described in obtaining from described Application Protocol Data Unit according to described reading address The correction data of relative address assembly, obtains in constant pool component from JAVA smart cards for storage area according to described correction data Index value, according to the correction data of the described relative address assembly reading, updates described untreatment data length and described reading Take address;
Described 6th judge module, for, after described first update module updates the order parameter that described JAVA instructs, judging The all data in described relative address assembly whether are processed;
Described output module, is additionally operable to judge owning in processed described relative address assembly when described 6th judge module After data, return success;
Described 7th judge module, for judging the institute in untreated complete described relative address assembly when described 6th judge module After having data, judge whether the data of the described relative address assembly in this Application Protocol Data Unit receiving has been located Reason completes;
Described output module, is additionally operable to judge the data in this Application Protocol Data Unit receiving when the 7th judge module After the completion of treated, return success;
Described receiver module, for having judged the data in this Application Protocol Data Unit receiving when the 7th judge module After the completion of treated, wait and receive the Application Protocol Data Unit of the data that the next one comprises described relative address assembly.
If 21. devices according to claim 14 are it is characterised in that the current corresponding JAVA of item data instructs as the first finger Order, described first judge module, specifically for judging the reference type of described first instruction;
Described first processing module, the reference type specifically for judging described first instruction when described first judge module is interior When portion quotes, the data of the Part I according to current item data obtains the first deviant, according to described first deviant and institute The category information assembly initial address stating JAVA smart cards for storage obtains category information physical address, according to described category information physical address Obtain the deviant of category information with EEPROM base address;
Described Second processing module includes the 21st acquiring unit, the 9th judging unit, the 9th updating block and the 22nd Acquiring unit;
Described 21st acquiring unit, the reference type for judging described first instruction when described first judge module is outer When portion quotes, obtain current item data Part II data as the bag being cited belonging to category information bag ID;
Described 9th judging unit, for judging whether the described bag ID that described 21st acquiring unit gets is less than first Preset value;
Described 9th updating block, for when described 9th judging unit judges that described bag ID is less than the first preset value, updating The order code of the first instruction;
Described 22nd acquiring unit, for when described 9th judging unit judge described bag ID be not less than the first preset value or Described 9th updating block update first instruction order code after, according to described bag ID obtain bag derivation table address, according to ought The derivation table address of the data of the Part III of front item data and bag, obtains the deviant of category information in the derived table of bag;
Described first update module, specifically for after described first processing module obtains described deviant, category information is inclined Shifting value, as described first parameter, updates the order parameter of described first instruction according to described first parameter;When the described 20th After two acquiring units get described deviant, using the deviant of category information as described first parameter, according to the described first ginseng Number updates the order parameter of described first instruction.
If 22. devices according to claim 14 are it is characterised in that the current corresponding JAVA of item data instructs as the second finger Order, described first judge module, specifically for judging the reference type of described second instruction;
Described first processing module, the reference type specifically for judging described second instruction when described first judge module is interior When portion quotes, the data of the Part I according to current item data obtains the first deviant, according to described first deviant and institute The category information assembly initial address stating JAVA smart cards for storage obtains category information physical address, according to described category information physical address Obtain the deviant of category information with EEPROM base address;
Described Second processing module includes the 23rd acquiring unit, the tenth judging unit, first processing units and second processing Unit;
Described 23rd acquiring unit, the reference type for judging described second instruction when described first judge module is outer When portion quotes, obtain current item data Part II data as the bag being cited belonging to category information bag ID, according to institute State the derivation table address that bag ID obtains bag;
Described tenth judging unit, for judging whether the described bag ID that described 23rd acquiring unit gets is less than first Preset value;
Described first processing units, for when described tenth judging unit judge described bag ID be less than the first preset value when, according to The current data of Part III of item data and the derivation table address of described bag, obtain the skew of category information in the derived table of bag Value, the deviant according to described category information and ROM base address obtain category information physical address;
Described second processing unit, for when described tenth judging unit judge described bag ID be not less than the first preset value when, root According to the data of the Part III of current item data and the derivation table address of described bag, the derived table of bag obtains the inclined of category information Shifting value, the deviant according to described category information and EEPROM base address obtain category information physical address;
Described first update module includes the 24th acquiring unit, the 11st judging unit, the 3rd processing unit, fourth process Unit, the 5th processing unit and the tenth updating block;
Described 24th acquiring unit, for obtaining category information physical address when described first processing module, or described first After processing unit obtains category information physical address, or described second processing unit obtains category information physical address, according to described class Information physical address, obtains current category information in JAVA smart cards for storage area;
Described 11st judging unit, for judging first of current category information that described 24th acquiring unit gets Whether the data divided is the second preset value;
When described 11st judging unit, described 3rd processing unit, for judging that the data of the Part I of current category information is During the second preset value, the data of the Part II according to current category information and ROM base address, obtain the parent of current category information The physical address of category information;
Described fourth processing unit, for judge when described 11st judging unit current category information Part I data not During for the second preset value, the data of the Part II according to current category information and EEPROM base address, obtain current category information The physical address of the category information of parent;
Described 5th processing unit, for obtaining current category information when described 3rd processing unit or described fourth processing unit After the physical address of the category information of parent, the physical address of the category information of the parent according to current category information, in described JAVA intelligence The data of the Part I of the category information of parent of current category information can be obtained in card memory area, according to the data getting with work as The data of the Part IV of front item data obtains index value;
Described tenth updating block, for after described 5th processing unit obtains described index value, using described index value as Described first parameter, updates the order parameter of described second instruction according to described first parameter.
If 23. devices according to claim 14 are it is characterised in that the current corresponding JAVA of item data instructs as the 3rd finger Order, described first judge module, specifically for judging the reference type of described 3rd instruction;
Described first processing module, the reference type specifically for judging described 3rd instruction when described first judge module is interior When portion quotes, the data of the Part I according to current item data obtains the first deviant, according to described first deviant and institute The category information assembly initial address stating JAVA smart cards for storage obtains category information physical address;
Described Second processing module include the 25th acquiring unit, the 12nd judging unit, at the 6th processing unit and the 7th Reason unit;
Described 25th acquiring unit, the reference type for judging described 3rd instruction when described first judge module is outer When portion quotes, obtain current item data Part II data as the bag being cited belonging to category information bag ID, according to institute State the derivation table address that bag ID obtains bag;
Whether described 12nd judging unit, for judging described bag ID that described 25th acquiring unit gets less than the One preset value;
Described 6th processing unit, for when described 12nd judging unit judge described bag ID be less than the first preset value when, root According to the data of the Part III of current item data and the derivation table address of described bag, the derived table of bag obtains the inclined of category information Shifting value, the deviant according to described category information and ROM base address obtain category information physical address;
Described 7th processing unit, for when described 12nd judging unit judge described bag ID be not less than the first preset value when, The derivation table address of the data of the Part III according to current item data and described bag, obtains category information in the derived table of bag Deviant, the deviant according to described category information and EEPROM base address obtain category information physical address;
Described first update module is specifically for obtaining described category information physical address when described first processing module or described 6th processing unit gets described category information physical address, or described 7th processing unit gets described category information physically Behind location, called method is obtained physically according to the data of described category information physical address and the Part IV of current item data Location, the physical address according to described called method obtains the number of parameters of called method in JAVA smart cards for storage area, The data of the 4th byte of the number of parameters according to called method and current item data obtains the first parameter, according to described One parameter updates the order parameter of described 3rd instruction.
If 24. devices according to claim 14 are it is characterised in that the current corresponding JAVA of item data instructs as the 4th finger Order, described first judge module, specifically for judging the reference type of described 4th instruction;
Described first processing module, the reference type specifically for judging described 4th instruction when described first judge module is interior When portion quotes, the data of the Part I according to current item data obtains the first deviant, according to described first deviant and institute The category information assembly initial address stating JAVA smart cards for storage obtains category information physical address;
Described Second processing module include the 26th acquiring unit, the 13rd judging unit, at the 8th processing unit and the 9th Reason unit;
Described 26th acquiring unit, the reference type for judging described 4th instruction when described first judge module is outer When portion quotes, obtain current item data Part II data as the bag being cited belonging to category information bag ID, according to institute State the derivation table address that bag ID obtains bag;
Whether described 13rd judging unit, for judging described bag ID that described 26th acquiring unit gets less than the One preset value;
Described 8th processing unit, for when described 13rd judging unit judge described bag ID be less than the first preset value when, root According to the data of the Part III of current item data and the derivation table address of described bag, the derived table of bag obtains the inclined of category information Shifting value, the deviant according to described category information and ROM base address obtain category information physical address, and update the instruction of the 4th instruction Code;
Described 9th processing unit, for when described 13rd judging unit judge described bag ID be not less than the first preset value when, The derivation table address of the data of the Part III according to current item data and described bag, obtains category information in the derived table of bag Deviant, the deviant according to described category information and EEPROM base address obtain category information physical address;
Described first update module is specifically for obtaining described category information physical address when described first processing module or described 8th processing unit gets described category information physical address, or described 9th processing unit gets described category information physically The skew ground of called method behind location, is obtained according to the data of described category information physical address and the Part IV of current item data Location, using the offset address of described called method as the first parameter, updates described 4th instruction according to described first parameter Order parameter.
If 25. devices according to claim 14 are it is characterised in that the current corresponding JAVA of item data instructs as the five fingers Order, described first judge module, specifically for judging the reference type of described 5th instruction;
Described first processing module, the reference type specifically for judging described 5th instruction when described first judge module is interior When portion quotes, the data of the Part V according to current item data obtains the second deviant, according to described second deviant and institute The static fields assembly initial address stating JAVA smart cards for storage obtains static fields physical address, according to described static fields physical address Obtain the offset address of accessed static fields with EEPROM base address;
Described Second processing module, the reference type specifically for judging described 5th instruction when described first judge module is outer When portion quotes, obtain current item data Part II data as the bag being cited belonging to category information bag ID, according to institute State and wrap the derivation table address that ID obtains bag, the derivation table address of the data of the Part I according to current item data and described bag, The offset address of accessed static fields is obtained in derived table;
Described first update module, specifically for obtaining the skew ground of described accessed static fields when described first processing module Location, or after described Second processing module obtains the offset address of described accessed static fields, described accessed static fields are inclined Move address as described first parameter, update the order parameter of described 5th instruction according to described first parameter.
If 26. devices according to claim 14 are it is characterised in that the current corresponding JAVA of item data instructs as the 6th finger Order, described first judge module, specifically for judging the reference type of described 6th instruction;
Described first processing module, the reference type specifically for judging described 6th instruction when described first judge module is interior When portion quotes, the data of the Part V according to current item data obtains the second deviant, according to described second deviant and institute The method assembly initial address stating JAVA smart cards for storage obtains method physical address, according to methods described physical address and EEPROM base address obtains the deviant of method;
Described Second processing module includes the 27th acquiring unit, the 14th judging unit, the 11st updating block and second 18 acquiring units;
Described 27th acquiring unit, the reference type for judging described 6th instruction when described first judge module is outer When portion quotes, obtain current item data Part II data as the bag belonging to called method bag ID;
Whether described 14th judging unit, for judging described bag ID that described 27th acquiring unit gets less than the One preset value;
When described 14th judging unit, described 11st updating block, for judging that described bag ID is less than described first preset value When, update the order code of described 6th instruction;
When described 14th judging unit, described 28th acquiring unit, for judging that described bag ID is pre- not less than described first If value, or after the order code of described 11st updating block renewal the 6th instruction, obtain the derived table ground of bag according to described bag ID Location, the derivation table address of the data of the Part V according to current item data and described bag, acquisition methods in the derived table of bag Deviant;
Described first update module, specifically for obtaining the deviant of methods described when described first processing module, or described After 28 acquiring units get the deviant of methods described, using the deviant of methods described as the first parameter, according to institute State the order parameter that the first parameter updates described 6th instruction.
CN201410160741.6A 2014-04-21 2014-04-21 Method and device for efficiently updating JAVA instruction Active CN103914326B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410160741.6A CN103914326B (en) 2014-04-21 2014-04-21 Method and device for efficiently updating JAVA instruction

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410160741.6A CN103914326B (en) 2014-04-21 2014-04-21 Method and device for efficiently updating JAVA instruction

Publications (2)

Publication Number Publication Date
CN103914326A CN103914326A (en) 2014-07-09
CN103914326B true CN103914326B (en) 2017-02-08

Family

ID=51040031

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410160741.6A Active CN103914326B (en) 2014-04-21 2014-04-21 Method and device for efficiently updating JAVA instruction

Country Status (1)

Country Link
CN (1) CN103914326B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105653351B (en) * 2015-12-30 2019-08-06 北京博思汇众科技股份有限公司 The optimization method and system of java card virtual machine
CN112230941B (en) * 2020-09-22 2024-03-29 成都融微软件服务有限公司 Java Card package and application program installation method and tool
CN113326041B (en) * 2021-08-02 2021-11-02 飞天诚信科技股份有限公司 Virtual method calling method, electronic equipment and computer readable storage medium
CN114968312B (en) * 2022-07-12 2022-11-22 紫光同芯微电子有限公司 Method, device and system for changing cap file of smart card
CN117056906B (en) * 2023-07-27 2024-03-29 北京握奇数据股份有限公司 Instruction access control method, system, storage medium and equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102103489A (en) * 2011-01-28 2011-06-22 武汉天喻信息产业股份有限公司 Method for improving execution efficiency of static field access command
CN103559073A (en) * 2013-10-28 2014-02-05 飞天诚信科技股份有限公司 Data management method based on Java card
CN103677778A (en) * 2012-09-18 2014-03-26 北京中电华大电子设计有限责任公司 Method for analyzing Classref constant of CAP file

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
MXPA05003360A (en) * 2002-10-18 2005-06-22 Sony Ericsson Mobile Comm Ab Method and device for downloading settings for an application.
FR2892261A1 (en) * 2005-10-17 2007-04-20 France Telecom METHOD AND SYSTEM FOR MANAGING APPLICATIONS OF A MOBILE TERMINAL

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102103489A (en) * 2011-01-28 2011-06-22 武汉天喻信息产业股份有限公司 Method for improving execution efficiency of static field access command
CN103677778A (en) * 2012-09-18 2014-03-26 北京中电华大电子设计有限责任公司 Method for analyzing Classref constant of CAP file
CN103559073A (en) * 2013-10-28 2014-02-05 飞天诚信科技股份有限公司 Data management method based on Java card

Also Published As

Publication number Publication date
CN103914326A (en) 2014-07-09

Similar Documents

Publication Publication Date Title
CN103914326B (en) Method and device for efficiently updating JAVA instruction
CN109034814B (en) Intelligent contract processing method and device based on Etheng virtual machine
CN100342329C (en) Zero expense abnormal treatment
CN106933610B (en) Application program installation package generation method and device and electronic equipment
CN104050080B (en) User space debugs the method and system of linux kernel
CN1359491A (en) Object-oriented instruction set for resource-constrained devices
CN106201893B (en) A kind of Java bytecode debugger and adjustment method
CN106502668B (en) A kind of interface package method and system for realizing Android JNI reflection
CN104375866B (en) The driving update method and device of a kind of veneer
CN106804055A (en) A kind of Wireless Fidelity Wi Fi connection methods and mobile terminal
CN107678740A (en) A kind of method for packing and computer equipment of UI Service Component
CN105653351B (en) The optimization method and system of java card virtual machine
CN110321170A (en) Starting-up method
CN101840373A (en) Data operating method and device, and addressing method and device
CN107479940A (en) A kind of method and device for realizing Internet of Things module
CN107301067A (en) Beidou subscriber machine remote update system and its upgrade method based on IAP technologies
CN105511935A (en) Resource index value acquiring method and device
CN110489207A (en) Verification method, apparatus and computer readable storage medium
CN106445546A (en) Method and device for establishing event system
CN109933410A (en) A kind of fictitious order delivery method and system based on virtualization technology
CN102541639A (en) CPU (Central Processing Unit) card data processing method, CPU card data processing system and CPU card
CN103366000B (en) A kind of analytic method of large volume XML message
CN108845864A (en) A kind of JVM rubbish recovering method and device based on spring frame
CN106775826A (en) A kind of method and system of use note mode loading code file
CN101295239A (en) Instruction execution method of Java card virtual machine

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant