CN106021088A - Method and device for atomicity test on JAVA card - Google Patents
Method and device for atomicity test on JAVA card Download PDFInfo
- Publication number
- CN106021088A CN106021088A CN201510404187.6A CN201510404187A CN106021088A CN 106021088 A CN106021088 A CN 106021088A CN 201510404187 A CN201510404187 A CN 201510404187A CN 106021088 A CN106021088 A CN 106021088A
- Authority
- CN
- China
- Prior art keywords
- power
- time
- card
- test command
- test
- 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.)
- Pending
Links
Landscapes
- Test And Diagnosis Of Digital Computers (AREA)
Abstract
The invention provides a method and a device for atomicity test on a JAVA card. The method comprises: using a power outage card reader to cut off power in an execution process of a test command, according to the state of the card after power outage, determining whether the test command has atomicity; firstly measuring complete execution time of the test command, and listing card states the test command allows after power outage; and according to step size the card reader can provide, performing power outage on the test command in increasing time; and checking the card states after power outage, if the state does not conform with the listed state, ending the test, if the state conforms with the listed state, increasing a step size and continuing to perform power outage. The method can perform power outage on all execution processes of a test command, and solves problems that time range of the test command for writing memory cannot be accurately positioned, and frequency is high, and a conventional power outage test method is not suitable to be used for a JAVA card. The method improves test efficiency and test coverage.
Description
Technical field
The present invention relates to field of intelligent cards, particularly relate to a kind of JAVA card atomicity method of testing and device.
Background technology
JAVA card is to run the smart card of JAVA card application.It follows unified international norm, can to oneself and should
With providing function and storage atomicity protection.The atomicity of JAVA card defines card in the case of interrupt error or fatal exception,
Updating single object territory or array content when, how to process the persistent storage of content.Atomicity protection object includes
Single content, such as object, territory, array element, also includes block, such as the set of multiple arrays.JAVA card externally provides interface,
Including application programming interface (API), for JAVA card application call.Also provide for order, interact outside JAVA card.Wherein
Some API and order should follow atomicity characteristic.Can by utilize power-off test in the way of to JAVA card standard API and order into
Row atomicity is tested.
Power-off is tested, and i.e. a kind of power-off card reader of application, sets a duration, after card sends test instruction, opens
Beginning timing, after reaching this duration, automatically cuts off card power supply, forces its stopping to process.Then card is powered on, check to be written
Data be value or write value before write.If both are neither, then judge atomicity shielding failure.If belonging to one of both,
Beginning to the test of power-off next time, duration increases a step-length (usually 1 percent ranks of write primary memory time).
In the power-off measuring technology erasable to memorizer, in order to shorten the testing time, measure first with waveform instrument
The memory write time range of test command, only carries out power-off test to this time range of test command.But in JAVA card
On, first, what JAVA card standard API and order realized be not only carries out erasable to data at, potentially includes multiple
The time range of memory write.Secondly, the JAVA card process required time to same order and API, is not to be one every time
Sample, may be affected by all steps that performs, the time range of its memory write can not be fixed.This 2 point so that traditional
The method first measuring in order one section of memory write time range re-test is not suitable for the atomicity test of JAVA card.
In sum, a kind of method needing to seek new power-off test, it is possible to the standard commands in JAVA card and API
Carry out atomicity test, and improve testing efficiency.
Summary of the invention
The present invention provides atomicity method of testing and device in a kind of JAVA card, with to the standard commands of JAVA card and API
Atomicity test, and improve testing efficiency.
The concrete technical scheme that the embodiment of the present invention provides is as follows:
Atomicity method of testing in a kind of JAVA card, including:
Determine power-off time scope, determine card atomicity state.
In the range of between when power is off, card is carried out power-off test.
Atom system safety testing device in a kind of JAVA card, including:
First processing unit, determines power-off time scope, determines card atomicity state;
Second processing unit, when power is off between in the range of, card is carried out power-off test.
Based on technique scheme, in the embodiment of the present invention, first with power-off card reader, measure the total of test command
Body performs the time, as the time range of power-off effect, order whole process is carried out power-off, solves and uses measure in advance to write
EEPROM time range is not fixed, thus immesurable problem, improve the coverage rate of power-off test simultaneously.Meanwhile, conjunction is determined
Method card status list, ensure that the reliability of test from design.
Accompanying drawing explanation
Fig. 1 be in the embodiment of the present invention in JAVA card the system architecture diagram of atomicity method of testing;
Fig. 2 is the structure drawing of device of atomicity method of testing in embodiment of the present invention JAVA card;
Fig. 3 be in the embodiment of the present invention in JAVA card the method flow diagram of testing results;
Detailed description of the invention
In order to solve the atomicity test problem of standard commands and API in JAVA card, embodiments provide one
Plant the method and device of atomicity test in JAVA card, it is possible to the atomicity test solving standard commands and API in JAVA card is asked
Topic, and improve testing efficiency.The method is: determine power-off time scope, determines card atomicity state.Model between when power is off
In enclosing, card is carried out power-off test.
Below in conjunction with the accompanying drawings the preferred embodiment of the present invention is described in detail.
Refering to shown in accompanying drawing 1, in the embodiment of the present invention, in JAVA card, the system of atomicity test mainly includes driving
Dynamic equipment 10, power-off card reader 11, and JAVA Card equipment 12, wherein,
Driving equipment 10, drives the operation that whole power-off is tested, and is issued to JAVA card 12 by power-off card reader 11
Corresponding test command and power-off duration, receive the JAVA card execution state that power-off card reader 11 sends;Concrete, to power-off
Card reader 11 sends test command and time range, and the described test command received is sent to JAVA Card by power-off card reader 11
Equipment 12.
Power-off card reader 11, for receiving test command and power-off duration from driving equipment 10, issues test command
To after JAVA card 12 start timing, when power is off between in the range of JAVA card 12 is carried out power-off test;
JAVA card 12, is used for performing test command, according to performing the execution state of results modification self and feeding back to disconnected
Electricity card reader 11.Concrete, according to performing result, the value of the state parameter that amendment test command is corresponding, different parameter values pair
Answering different states, the state parameter that different test commands is corresponding is different, test command and the state parameter of correspondence thereof and parameter
Value is determined by JAVA card self-characteristic, for example, it is possible to arrange execution by the value of residue number of attempt (try counter)
State, the value of described try counter is saved in JAVA card, JAVA card perform result according to test command and be configured,
The initial value of try counter is such as set, it is assumed that be 10, if try counter is initial value, for being not carried out state, if
Put the maximum of try counter, it is assumed that be 20, if try counter is maximum, for the state performed, perform into
Merit.
Refering to shown in accompanying drawing 2, in the embodiment of the present invention, drive the dress of atomicity test on equipment 10, i.e. JAVA card
Put and mainly include following processing unit:
First processing unit 111, is used for determining power-off time scope, determines card atomicity state;
Second processing unit 112, for receiving the execution state that power-off card reader 11 sends.
Further, the first processing unit 111, for test command and power-off time are sent to power-off card reader 11,
And notifying the second processing unit 112, described power-off time is 0;
Second processing unit 112, is used for recording test command and sends the time, receive the shape that power-off card reader 11 sends
State word, and record the reception time, obtain the time interval receiving time and test command transmission time of record, for test command
The time that completely performs;
Accordingly, JAVA card 12, it is used for receiving test command and performing, the status word after having performed passes through power-off
Card reader 11 is sent to the second processing unit 112.
Further, the second processing unit 112, for adding the local preset time sending test command by 0,
As the starting point of power-off time scope, add the complete execution time of test command, as the terminal of power-off time scope.
Further, the first processing unit 111, for sending reset command to power-off card reader 11;
Power-off card reader 11, for being sent to JAVA card 12 by described reset command;
JAVA card 12, is used for receiving reset command, by execution status modifier for being not carried out.
Based on said system framework, refering to shown in accompanying drawing 3, in the embodiment of the present invention, in JAVA card, atomicity is surveyed
The method detailed flow process of examination is as follows:
Step 301: determine power-off time scope, determines card atomicity state;
Wherein determine power-off time scope, comprise determining that the beginning and end of time range.Rising of described time range
Point should be for 0 time sending test command plus driving equipment, and this section of time value is for being preset at driving device interior.Then measure
Test command completely perform required time, during this period of time plus the starting point of time range as time range terminal.
Described measure test command completely perform required time, method is: drive equipment by power-off card reader to
JAVA card sends test command and power-off time, and power-off time is set to 0, makes card reader order the term of execution, does not do disconnected
Electricity, after JAVA card performs test command, returns status word, and driving equipment receives the status word sent by power-off card reader, drives
Dynamic equipment record sends test command and receives the time of status word, and middle time interval is test command and completely performs required
Time.Measure test command complete perform required time before and afterwards, needing JAVA card carries out the operation that resets, tool
Body is: driving equipment sends reset command by power-off card reader to JAVA card, after JAVA card receives reset command, by self
Execution state be set to be not carried out state.
Wherein it is determined that card atomicity state, refer to: according to JAVA card Platform Designing and standard criterion requirement, row
Go out under normal circumstances, atomicity state, including, unenforced state, the state before i.e. test command is not carried out;Performed
The state that state, i.e. test command are all finished;Part execution state, the state that i.e. test command part is finished,
Described atomicity state, can set according to the value of state parameter.
Step 302: in the range of between when power is off, carries out power-off test to JAVA card.
Wherein, JAVA card is carried out power-off test, including: test command and power-off time scope are sent out by driving equipment
Giving power-off card reader, test command is sent to JAVA card and starts timing by power-off card reader, and JAVA card performs test command,
Power-off card reader determines that current time reaches the starting point of time range, performs power operation, reads JAVA CARD state, if JAVA
Card state is not atomicity state, then send error report to the equipment of driving, if in above-mentioned three kinds of state range, then according to tool
Body state performs corresponding operation.Concrete, if running succeeded or the third state, driving equipment restarts JAVA card
Reset operation, performs step 301, if the situation of being not carried out, this state is sent to driving equipment by power-off card reader, exists simultaneously
Increase a step-length in the starting point of time range, arrive the time after increasing in current time, again perform power operation, lay equal stress on
Multiple aforementioned operation.Here step-length refers to interval of time, is set to 1-100 microsecond generally according to experience.Power-off simultaneously
Before card reader performs power operation, by current time, the time of power operation to be performed compares with the terminal of time range,
If being not above the terminal of time range, then perform power operation;If the terminal of overtime scope, then stop power-off test,
And the information stopping test being fed back to driving equipment.
In embodiments of the invention, determine power-off time scope can referred to as preparation part, follow-up include de-energized portion
And the inspection part of subsequent process steps after power-off, is determined according to execution state, this three part is separate, respective amendment
Do not affect the realization of the overall situation, the function of power-off test program can be realized, it is achieved be simple, and, due to the independence of each several part,
The each several part amendment of power-off test, has no effect on former test case;Measure the complete implementation time of test command in advance, it is achieved that
Omnidistance power-off to test command, on the one hand, avoid the test object each correcting of JAVA card platform and be required for measuring one by one survey
The work writing EEPROM time range in examination order, improves testing efficiency.On the one hand, to test command whole process power-off,
Also improve test coverage.
Obviously, those skilled in the art can carry out various change and the deformation essence without deviating from the present invention to the present invention
God and scope.So, if the present invention these amendment and deformation belong to the claims in the present invention and equivalent technologies thereof scope it
In, then the present invention is also intended to comprise these change and modification.
Claims (10)
1. atomicity method of testing in a JAVA card, it is characterised in that the method includes:
Determine power-off time scope, determine card atomicity state;
In the range of between when power is off, JAVA card is carried out power-off test.
Method the most according to claim 1, it is characterised in that described determine power-off time scope, including:
Determining the beginning and end of time range, wherein, 0 sends the starting point that the time is time range of test command plus driving equipment, it is preset at driving equipment content,, measure test command completely performs required time, adds that the starting point of time range is as time range terminal during this period of time.
Method the most according to claim 2, it is characterised in that described in measure test command completely perform required time, including:
Driving equipment sends test command and power-off time by power-off card reader to JAVA card, power-off time is set to 0, make card reader order the term of execution, do not do power-off, after JAVA card performs test command, returning status word, driving equipment receives the status word sent by power-off card reader, driving equipment record sends test command and receives the time of status word, and middle time interval is test command and completely performs required time.
Method the most according to claim 1, it is characterised in that described determine card atomicity state, including: according to card design, list card after test command fails completely to perform, under normal circumstances, the state that should locate.
Method the most according to claim 1, it is characterised in that card is carried out power-off test, including:
In the range of the power-off testing time, from the off, increase a step-length every time, as the execution time of this test test command, first judge whether the current power-off time to test command exceedes the terminal of power-off time scope;
If exceeding the full time of test command, then stop power-off test.
If not less than the full time of test command, then execution test command is to this time, is then cut off card working power, after electrification reset, it is judged that card state is the most legal.
Method the most according to claim 5, it is characterised in that determine card atomicity state, including: according to card Platform Designing and standard criterion requirement, list card after test command fails completely to perform, under normal circumstances, residing several states.
7. atom system safety testing device in a JAVA card, it is characterised in that this device includes:
Driving equipment, for the operation driving whole power-off to test, issues corresponding test command and power-off duration by power-off card reader to JAVA card, receives the JAVA card execution state that power-off card reader sends;
Power-off card reader, for receiving test command and power-off duration from the equipment of driving, starts timing after test command is handed down to JAVA card, when power is off between in the range of JAVA card is carried out power-off test;
JAVA card, is used for performing test command, according to performing the execution state of results modification self and feeding back to power-off card reader.
Device the most according to claim 7, it is characterised in that described driving equipment includes the first processing unit and the second processing unit;Wherein,
First processing unit, is used for determining power-off time scope, determines card atomicity state;
Second processing unit, for receiving the execution state that power-off card reader sends.
Device the most according to claim 8, it is characterised in that
Described first processing unit, for test command and power-off time are sent to power-off card reader, and notifies that the second processing unit, described power-off time are 0;
Second processing unit, is used for recording test command and sends the time, receive the status word that power-off card reader sends, and record the reception time, and the time that receives and the test command of acquisition record send the time interval of time, for the time that completely performs of test command;By 0 plus the local preset time sending test command, as the starting point of power-off time scope, add the complete execution time of test command, as the terminal of power-off time scope;
Accordingly, JAVA card, it is used for receiving test command and performing, the status word after having performed is sent to the second processing unit by power-off card reader.
10. want the device described in 8 according to right, it is characterised in that
Described first processing unit, for sending reset command to power-off card reader;
Power-off card reader, for being sent to JAVA card by described reset command;
JAVA card, is used for receiving reset command, by execution status modifier for being not carried out.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510404187.6A CN106021088A (en) | 2015-07-10 | 2015-07-10 | Method and device for atomicity test on JAVA card |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510404187.6A CN106021088A (en) | 2015-07-10 | 2015-07-10 | Method and device for atomicity test on JAVA card |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106021088A true CN106021088A (en) | 2016-10-12 |
Family
ID=57082409
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510404187.6A Pending CN106021088A (en) | 2015-07-10 | 2015-07-10 | Method and device for atomicity test on JAVA card |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106021088A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112712356A (en) * | 2020-12-30 | 2021-04-27 | 深圳杰睿联科技有限公司 | Method and system for configuring Java Card parameter |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH1124712A (en) * | 1997-06-27 | 1999-01-29 | Yaskawa Electric Corp | Programmable controller |
EP1603042A2 (en) * | 2004-06-02 | 2005-12-07 | Proton World International N.V. | Method and system for verifying command atomicity in a microprocessor |
CN102662806A (en) * | 2012-02-29 | 2012-09-12 | 浙江大学 | Adaptive testing method directed at different performance indicators of Java card |
CN102866312A (en) * | 2012-08-30 | 2013-01-09 | 东信和平科技股份有限公司 | Intelligent card reader-writer power failure test capturing method based on current mutation and reader-writer |
CN103377151A (en) * | 2012-04-16 | 2013-10-30 | 福建星网视易信息***有限公司 | Hard disk power-down protecting method and electronic equipment using same |
CN103678067A (en) * | 2013-12-19 | 2014-03-26 | 大唐微电子技术有限公司 | Test method and device for intelligent card power failure and tested device |
CN104572371A (en) * | 2014-12-25 | 2015-04-29 | 记忆科技(深圳)有限公司 | Abnormal power-down testing system for hard disk |
-
2015
- 2015-07-10 CN CN201510404187.6A patent/CN106021088A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH1124712A (en) * | 1997-06-27 | 1999-01-29 | Yaskawa Electric Corp | Programmable controller |
EP1603042A2 (en) * | 2004-06-02 | 2005-12-07 | Proton World International N.V. | Method and system for verifying command atomicity in a microprocessor |
CN102662806A (en) * | 2012-02-29 | 2012-09-12 | 浙江大学 | Adaptive testing method directed at different performance indicators of Java card |
CN103377151A (en) * | 2012-04-16 | 2013-10-30 | 福建星网视易信息***有限公司 | Hard disk power-down protecting method and electronic equipment using same |
CN102866312A (en) * | 2012-08-30 | 2013-01-09 | 东信和平科技股份有限公司 | Intelligent card reader-writer power failure test capturing method based on current mutation and reader-writer |
CN103678067A (en) * | 2013-12-19 | 2014-03-26 | 大唐微电子技术有限公司 | Test method and device for intelligent card power failure and tested device |
CN104572371A (en) * | 2014-12-25 | 2015-04-29 | 记忆科技(深圳)有限公司 | Abnormal power-down testing system for hard disk |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112712356A (en) * | 2020-12-30 | 2021-04-27 | 深圳杰睿联科技有限公司 | Method and system for configuring Java Card parameter |
CN112712356B (en) * | 2020-12-30 | 2022-04-15 | 深圳杰睿联科技有限公司 | Method and system for configuring Java Card parameter |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106571166B (en) | MT29F series NAND FLASH test aging system with customizable flow | |
CN110618892A (en) | Bug positioning method and device for solid state disk, electronic equipment and medium | |
CN115954042A (en) | nand flash power-down test device, nand flash power-down test method and storage medium | |
CN105279092A (en) | Software testing method and apparatus | |
CN108647140A (en) | A kind of test method and test system of mobile terminal | |
CN109684166A (en) | Method, apparatus, terminal and the storage medium of automatic test Sensor log normalization | |
CN111752243B (en) | Production line reliability testing method and device, computer equipment and storage medium | |
CN105824730A (en) | Method and device for diagnosing and repairing hardware | |
CN110739025B (en) | Power failure test method, device and system for storage equipment | |
CN112073263A (en) | Method, system, equipment and medium for testing and monitoring reliability of white box switch | |
CN102074273B (en) | Memory homeostasis total dosage effect experiment testing method | |
CN113010423A (en) | Method and device for detecting reliability of electric energy meter software, computer equipment and medium | |
CN113960391A (en) | Abnormal power failure testing device and method for storage medium | |
CN106021088A (en) | Method and device for atomicity test on JAVA card | |
CN115602242B (en) | Storage device and test method thereof | |
CN108959078A (en) | A kind of end Windows automatic software test method and system | |
CN110473586B (en) | Replacement method, device and equipment for write failure storage unit and storage medium | |
CN106610862B (en) | Emulator supporting EEPROM power-down test | |
CN114584498A (en) | Method, device, equipment, system and product for testing power on and power off of gateway equipment | |
CN103064789B (en) | A kind of automated testing method of software control | |
CN102163461A (en) | Method for improving yield and reading reliability of electrically erasable programmable read-only memory (EEPROM) | |
CN113409873B (en) | System, method and executing device for testing erasing interference | |
CN114363145A (en) | BIT fault injection and detection time sequence control method for airborne electronic system | |
CN112530615B (en) | Variable forcing method and system suitable for nuclear power station equipment | |
CN116453582B (en) | Signal testing system and method for memory |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
DD01 | Delivery of document by public notice |
Addressee: Beijing CEC Huada Electronic Design Co., Ltd. Document name: Notification to Make Rectification Addressee: Beijing CEC Huada Electronic Design Co., Ltd. Document name: Notice of amendment |
|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20161012 |