CN107730253A - A kind of offline transaction aging management method and device - Google Patents

A kind of offline transaction aging management method and device Download PDF

Info

Publication number
CN107730253A
CN107730253A CN201710830874.3A CN201710830874A CN107730253A CN 107730253 A CN107730253 A CN 107730253A CN 201710830874 A CN201710830874 A CN 201710830874A CN 107730253 A CN107730253 A CN 107730253A
Authority
CN
China
Prior art keywords
module
blacklist
transaction
smart card
proprietary
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.)
Granted
Application number
CN201710830874.3A
Other languages
Chinese (zh)
Other versions
CN107730253B (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 CN201710830874.3A priority Critical patent/CN107730253B/en
Publication of CN107730253A publication Critical patent/CN107730253A/en
Application granted granted Critical
Publication of CN107730253B publication Critical patent/CN107730253B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/30Payment architectures, schemes or protocols characterised by the use of specific devices or networks
    • G06Q20/34Payment architectures, schemes or protocols characterised by the use of specific devices or networks using cards, e.g. integrated circuit [IC] cards or magnetic cards
    • G06Q20/357Cards having a plurality of specified features
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3829Payment protocols; Details thereof insuring higher security of transaction involving key management

Landscapes

  • Business, Economics & Management (AREA)
  • Engineering & Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Physics & Mathematics (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Finance (AREA)
  • Computer Security & Cryptography (AREA)
  • Microelectronics & Electronic Packaging (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Control Of Vending Devices And Auxiliary Devices For Vending Devices (AREA)

Abstract

The present invention relates to information security field, more particularly to a kind of offline transaction aging management method and device, the aging management method specifically include:When terminal device gets the Application Serial Number of smart card, judge Application Serial Number whether terminal device storage proprietary blacklist row, on-line transaction time last time is obtained from the smart card if not in the row of proprietary blacklist, and judge whether the time difference of current consumption time and on-line transaction time last time are more than preset value, the initialization consumption response that smart card transmission is received if no more than preset value continues executing with offline transaction, using technical scheme provided by the invention, realize control of the smart card to blacklist quantity during offline transaction, the offline transaction time can effectively be shortened, improve offline transaction efficiency.

Description

A kind of offline transaction aging management method and device
Technical field
The present invention relates to information security field, more particularly to a kind of offline transaction aging management method and device.
Background technology
Smart card has the function of information processing;Smart card due to its intrinsic information security, be easy to carry, fairly perfect Standardization the advantages that, authentication, bank, telecommunications, public transport, parking lot management etc. field obtain more and more should With.
When carrying out offline transaction, terminal needs to carry out smart card validity inspection smart card, and smart card is effective at present Property check and include judging smart card whether in blacklist, blacklist is used for the intelligence that storage is failed due to the reason such as reporting the loss to cause Can card mark;Over time, the quantity of reporting the loss of smart card gradually increases, and causes the blacklist quantity for being stored in terminal Gradually increase, the time that blacklist is retrieved when carrying out offline transaction also increase, and offline transaction efficiency reduces.
The content of the invention
The purpose of the present invention is the defects of overcoming prior art, there is provided a kind of offline transaction aging management method, specific bag Include:
Step S1, when terminal device gets the Application Serial Number of smart card, judge Application Serial Number whether in terminal The row of the proprietary blacklist of equipment storage, are to carry out error handle;Otherwise step S2 is performed;
Step S2, terminal device obtains on-line transaction time last time from smart card, and judges current consumption time and upper Whether the time difference of secondary on-line transaction time is more than preset value, is to carry out error handle;Otherwise send and initialize to smart card Consumption order, performs step S3;
Step S3, terminal device receives the initialization consumption response that smart card is sent, according in initialization consumption response Pseudo random number and offline transaction sequence number generate the first process key, using the first process key to dealing money, type of transaction Mark, terminating machine numbering and exchange hour, which are encrypted, produces the first message authentication code, and sends to smart card and handed over comprising terminal The consumption order of easy sequence number, exchange hour and the first message authentication code;
Step S4, terminal device receives the consumption command response that smart card is sent, and judges to consume second in command response Whether message authentication code is effective, is then offline transaction success, generates transaction record;Otherwise offline transaction fails, generation transaction note Record.
The present invention also provides a kind of device of offline transaction prescriptive jurisdiction, including:
Acquisition module:For obtaining the Application Serial Number of smart card, it is additionally operable to obtain last time on-line transaction from smart card Time;
Memory module, for storing proprietary blacklist;
First judge module, during Application Serial Number for getting smart card when acquisition module, judge Application Serial Number Whether memory module storage proprietary blacklist row;
Second judge module, for when the first judge module judges Application Serial Number not in the row of proprietary blacklist, sentencing Whether the time difference for on-line transaction time last time that disconnected current consumption time and acquisition module are got is more than preset value;
Error handling module, it is wrong for being carried out when the first judge module judges Application Serial Number in the row of proprietary blacklist Handle by mistake;It is additionally operable to when the second judge module judges current consumption time and on-line transaction time last time that acquisition module is got Time difference carry out error handle when being more than preset value;
Sending module, for judging that the last time that current consumption time and acquisition module are got is online when the second judge module When the time difference of exchange hour is not more than preset value initialization consumption order is sent to smart card;It is additionally operable to send to smart card and wraps The consumption of first message authentication code of sequence number containing terminal transaction, current exchange hour and the generation of the first message authentication code generation module Order;
Command response is consumed in receiving module, the initialization for receiving smart card transmission;It is additionally operable to receive smart card transmission Consumption command response;
First message authentication code generation module, for when receiving module receive initialization consumption response when, according to initial Change the pseudo random number in consumption response and offline transaction sequence number generates the first process key, using the first process key to transaction The amount of money, type of transaction mark, terminating machine numbering and exchange hour are encrypted and produce the first message authentication code;
3rd judge module, for when receiving module receives consumption command response, judging to consume in command response Whether the second message authentication code is effective;
Transaction record generation module, for judging the second message authentication code in consumption command response when the 3rd judge module When effective, offline transaction success, transaction record is generated;It is additionally operable to when the 3rd judge module judges second in consumption command response When message authentication code is invalid, offline transaction failure, transaction record is generated.
The beneficial effects of the present invention are:Using technical scheme provided by the invention, smart card is realized in offline transaction During control to blacklist quantity, can effectively shorten the offline transaction time, improve offline transaction efficiency.
Brief description of the drawings
, below will be to embodiment or existing for the clearer explanation embodiment of the present invention or technical scheme of the prior art There is the required accompanying drawing used in technology description to be briefly described, it should be apparent that, drawings in the following description are only this Some embodiments of invention, for those of ordinary skill in the art, on the premise of not paying creative work, can be with Other accompanying drawings are obtained according to these accompanying drawings.
Fig. 1 is a kind of flow chart for offline transaction aging management method that the embodiment of the present invention 1 provides;
Fig. 2 and Fig. 3 is a kind of flow chart of the offline transaction aging management method provided in the embodiment of the present invention 2;
Fig. 4 and Fig. 5 is a kind of flow chart of the offline transaction aging management method provided in the embodiment of the present invention 3;
Fig. 6 is a kind of block diagram for offline transaction prescriptive jurisdiction device that the embodiment of the present invention 4 provides.
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 describes;Obviously, described embodiment is only part of the embodiment of the present invention, rather than whole embodiments.It is based on Embodiment in the present invention, the every other implementation that those skilled in the art are obtained under the premise of creative work is not made Example, belongs to the scope of protection of the invention.
Embodiment 1
The present embodiment provides a kind of offline transaction aging management method, referring to Fig. 1, including:
Step S1, when terminal device gets the Application Serial Number of smart card, judge Application Serial Number whether in terminal The row of the proprietary blacklist of equipment storage, are to carry out error handle;Otherwise step S2 is performed;
Step S2, terminal device obtains on-line transaction time last time from smart card, and judges current consumption time and upper Whether the time difference of secondary on-line transaction time is more than preset value, is to carry out error handle;Otherwise send and initialize to smart card Consumption order, performs step S3;
It should be noted that on-line transaction time last time is specially the smart card the last on-line transaction time;This reality Apply in example, when smart card carries out on-line transaction, the last time connection preserved in current exchange hour renewal smart card need to be obtained and handed over The easy time.
Error handle specifically includes:Terminal device, which reports an error, shows or reports an error and produce prompt tone.
Preferably, when terminal device judges that the time difference of current consumption time and on-line transaction time last time are more than preset value Afterwards, in addition to:Terminal device judge Application Serial Number whether terminal device storage complete blacklist row, be to carry out Error handle, otherwise perform step S3.
It should be noted that proprietary blacklist is used to store and reports the loss the time in complete blacklist and be in preset time period Blacklist;When a length of preset value of preset time period.
Step S3, terminal device receives the initialization consumption response that smart card is sent, according in initialization consumption response Pseudo random number and offline transaction sequence number generate the first process key, using the first process key to dealing money, type of transaction Mark, terminating machine numbering and exchange hour, which are encrypted, produces the first message authentication code, and sends to smart card and handed over comprising terminal The consumption order of easy sequence number, exchange hour and the first message authentication code;
Specifically, step S3 is specially:Terminal device receives the initialization consumption response that smart card is sent, according to initialization Consumption response in pseudo random number and offline transaction sequence number generate the first process key, by dealing money, type of transaction mark, Terminating machine is numbered and exchange hour sequential concatenation, and spliced data are encrypted using the first process key to obtain encryption number According to using preceding four bytes of encryption data as the first message authentication code.
Step S4, terminal device receives the consumption command response that smart card is sent, and judges to consume second in command response Whether message authentication code is effective, is then offline transaction success, generates transaction record;Otherwise offline transaction fails, generation transaction note Record.
Specifically, step S4 includes:
Step 201, terminal device receive the consumption command response that smart card is sent, and second is obtained from consumption command response Message authentication code, dealing money is encrypted using the first process key the 3rd message authentication code of generation;
Step 202, terminal device judge whether the 3rd message authentication code and the second message authentication code are consistent, are then off line friendships Easily success, generate transaction record;Otherwise offline transaction fails, and generates transaction record.
Preferably, terminal device periodically obtained from management system and preserve proprietary blacklist or terminal device periodically from Obtained in management system and preserve proprietary blacklist and complete blacklist;
Further, when terminal device has online condition, proprietary blacklist and complete is downloaded from management system Blacklist downloads proprietary blacklist from management system.
Optionally, step S2 can be replaced:Terminal device sends initialization consumption order to smart card;
Accordingly, after step S3, also include before S4:Smart card judges consumption time and last time connection in consumption order Whether the time difference of machine exchange hour is more than preset time period, is to carry out error handle, terminates;Otherwise returned to terminal device Command response is consumed, performs step S4.
Preferably, also include before step S1:Terminal device sends the choosing application comprising application identifier to smart card please Ask;The credit card issuer proprietary data returned etc. smart card to be received, credit card issuer proprietary data include the Application Serial Number of smart card. Specifically included in credit card issuer proprietary data:Bank identification symbol, application type mark, credit card issuer application version number, application sequence Number, using enable the date, using validity date and credit card issuer self-defining data.
Preferably, also include before step S1:
Step 101, terminal device judge whether to support the bank identification symbol in credit card issuer proprietary data;It is then to perform step Rapid 102, otherwise carry out error handle;
Step 102, terminal device judge whether to support on smart card according to application type mark in credit card issuer exclusive data Application, be then execution step 103, otherwise carry out error handle;
Step 103, terminal device judge whether to support the application representated by the application version number in credit card issuer exclusive data Version, it is then to perform step 104, otherwise carries out error handle;
The application term of validity of step 104, terminal device in credit card issuer proprietary data judges whether Step S1 is then performed, otherwise carries out error handle.
Embodiment 2
Blacklist maintaining method is specifically included in management system, and complete blacklist and proprietary black name are preserved in management system Singly include:
Step A1, when management system, which receives, reports the loss application, Application Serial Number is obtained from reporting the loss in application;And should by this Complete blacklist is write with sequence number;
Step A2, the transaction record corresponding to the Application Serial Number that management system is inquired about and got, from transaction record Obtain the last time on-line transaction time;
Step A3, management system obtains the current server time, judges last time on-line transaction time and current service Whether the time difference of device time is less than preset time period, is that the Application Serial Number then is write into proprietary blacklist;Otherwise terminate.
For example, preset time period is 12 months, reports the loss and recorded in the transaction record corresponding to the Application Serial Number in application The last time on-line transaction time be on January 1st, 2015;When the current server time is on May 1st, 2015, then finally The time difference of on-line transaction time and current server time are less than preset time period, Application Serial Number are write proprietary black List, then last time on-line transaction time and current server time when the current server time is on January 2nd, 2016 Time difference is not less than preset time, terminates.
Also include after step A3:Management system is regularly updated in proprietary blacklist, is specifically included, and card issuer server is regular Obtained from proprietary blacklist and report the loss the time as the Application Serial Number in the preset time period before the current server time, according to Proprietary blacklist after the Application Serial Number generation renewal got.
The present embodiment provides a kind of offline transaction aging management method, and terminal device is periodically downloaded proprietary from management system Blacklist;Referring to Fig. 2 and Fig. 3, specifically include:
Step 101, terminal device check whether smart card is already inserted into card reader, are then to perform step 102, otherwise return Step 101;
Step 102, terminal device are sent to smart card selects application request comprising application identifier;
Specifically, the command message form for selecting application request that terminal device is sent is specially:CLA+INS+P1+P2+Lc+ Data+Le;CLA is order classification, and INS is command code, and P1 and P2 are command parameter;Data is order data domain;Lc is life The length of data field is made, Le is the maximum number of byte of desired reply data;
In the present embodiment, terminal device calculation command data field 3F01 length, specially 02;By command type 00, life Make code A4, command parameter 00 00, the length 02 in order data domain, order data domain 3F01 and desired reply data The sequential concatenation of maximum number of byte 00 obtains selecting application request, selects the application request to be specially:00 A4 00 00 02 3F01 00.
Step 103, smart card judge whether to support application corresponding with application identifier, are then to send to send out to terminal device Card row exclusive data;Otherwise send choosing to terminal device and apply failure response, terminate;
Specifically, credit card issuer exclusive data includes:Bank identification symbol, application type mark, credit card issuer application version number, Application Serial Number, using enable the date, using validity date and credit card issuer self-defining data.
In the present embodiment, the credit card issuer exclusive data that terminal device receives is:CFC3C3C5D2D7CDA8 02 01 00112233445566778899 20,161,118 20261118 FFFF, read first character section to the 8th byte and sent out Card row identifier CFC3C3C5D2D7CDA8, read the 9th byte and be applied type identification 02, read the tenth byte and obtain To credit card issuer application version number 01, read the 11st byte to the 20th byte and be applied sequence number 00112233445566778899, the 21st byte of reading is applied to the 24th byte enables the date 20161118, i.e. on November 18th, 2016;Read the 25th byte and be applied to the 28th byte and enable the date 20261118, i.e. on November 18th, 2026;Read the 29th byte to the 30th byte and obtain the self-defined number of credit card issuer According to FFFF.
The bank identification symbol and Application Serial Number that step 104, terminal device include according to credit card issuer exclusive data judge Smart card whether terminal device storage proprietary blacklist row, be then error handle, terminate;Otherwise step 105 is performed;
Step 105, terminal device judge whether to support the bank identification symbol in credit card issuer proprietary data;It is then to perform step Rapid 106, otherwise error handle, terminates
Step 106, terminal device judge whether to support on smart card according to application type mark in credit card issuer exclusive data Application, be then execution step 107, otherwise error handle, terminate;
Step 107, terminal device judge whether to support the application representated by the application version number in credit card issuer exclusive data Version, it is then to perform step 108, otherwise error handle, terminates;
The application term of validity of step 108, terminal device in credit card issuer proprietary data judges whether Then terminal device sends initialization consumption order to smart card, and otherwise error handle, terminates;
Specifically, initialization consumption order INITIALIZE FOR PURCHASE are used to initialize consumer sale;Wherein INITIALIZE FOR PURCHASE command message forms are specially:CLA+INS+P1+P2+Lc+Data+Le;CLA is order Classification, INS are command code, and P1 and P2 are command parameter;Data is order data domain;Lc be order data domain length, Le It is the maximum number of byte of desired reply data;
In the present embodiment, the order data domain Data of initialization consumption order is specifically included:Cipher key index number, dealing money Numbered with terminating machine.
In more detail, terminal device is specially to smart card transmission initialization consumption order:Terminal device is by key rope Quotation marks 01, dealing money 00 00 00 64 and the sequential concatenation of terminating machine numbering 00 00 00 00 00 00 obtain order data Domain, calculation command data field length 0B, by command type 80, command code 50, command parameter 01 02, order data length of field 0B, order data domain 01 00,000,064 000000000000 and expectation the reply data sequential concatenation of maximum number of byte 00 obtain Smart card is sent to initialization consumption order, and by obtained initialization consumption order.
Step 109, smart card judge whether to support the cipher key index number provided in initialization consumption order, are then to perform step Rapid 110;Otherwise sending does not support cipher key index to respond, and terminates;
After smart card judges the cipher key index for not supporting to provide in initialization consumption order, to terminal device loopback Cipher key index status word 9403 is not supported, terminates off-line consumption;
Step 110, smart card judge whether card balance is more than or equal in initialization consumption order and provide trade gold Volume, be then execution step 111, otherwise send card Sorry, your ticket has not enough value response, terminate;
Returned when smart card judges that card balance is less than the dealing money provided in initialization consumption order to terminal device Card feed Sorry, your ticket has not enough value status word 9401, terminate off-line consumption;
Step 111, smart card generation pseudo random number, and current offline transaction sequence number is obtained, send and include to terminal device The initialization consumption response of offline transaction sequence number and pseudo random number;
The initialization response data that terminal device receives in the present embodiment are specially:00003A98 0000 000000 01 00 CD701726, read first character section to the 4th byte and obtain electronic purse balance amount 00003A98;Read the 5th Byte to the 6th byte obtains offline transaction sequence number 0000;Read the 7th byte to the 9th byte and obtain the limit of overdrawn account 000000;Read the tenth byte and obtain key version number 01;Read the 11st byte and obtain algorithm mark 00;Read the tenth Two bytes to the 15th byte obtains the pseudo random number CD701726 of smart card generation.
Step 112, terminal device obtain terminal transaction sequence number, according to pseudo random number, offline transaction sequence number and terminal transaction The process key of serial number gencration first;
The generation method of first process key is specially:Terminal device is by pseudo random number, offline transaction sequence number and terminal Most latter two byte order splicing of sequence number;Recycle consumer sub-cipher key DPK that spliced data are disperseed to obtain with the One process key;
Step 113, terminal device using the first process key to dealing money, type of transaction identify, terminating machine numbering and Exchange hour, which is encrypted, produces the first message authentication code;
Specifically, terminal device is by dealing money, type of transaction mark, terminating machine is numbered and exchange hour sequential concatenation, Spliced data are encrypted using the first process key to obtain encryption data, preceding four bytes of encryption data are first Message authentication code;
Step 114, terminal device are sent to smart card includes terminal transaction sequence number, exchange hour and the first message authentication code Consumption order;
Specifically, consumption order DEBIT FOR PURCHASE are used for consumer sale;Wherein DEBIT FOR PURCHASE Command message form is specially:CLA+INS+P1+P2+Lc+Data+Le;CLA is order classification, and INS is command code, P1 and P2 is command parameter;Data is order data domain;Lc is the length in order data domain, and Le is the maximum word of desired reply data Joint number;
The order data domain of consumption order specifically includes:Terminal transaction sequence number, exchange hour and the first message authentication code MAC1。
Specifically, terminal device is by terminal transaction sequence number 00000001, exchange hour 20161216 in the present embodiment 00 divides 12 seconds and the first message authentication code E599F35208 sequential concatenations are ordered during 160012 i.e. 16 days 16 December in 2016 Make data field, calculation command data field length 0F;By command type 80, command code 54, command parameter 01 00, order data Length of field 0F, the E599F35208 of order data domain 00,000,001 20,161,216 160012 and desired reply data are most The big sequential concatenation of byte number 00 obtains consumption order, and consumption order is specially:80 54 01 00 0F 00000001 20161216 160012 E599F35208 00。
Step 115, smart card obtain on-line transaction time last time, judge consumption order in exchange hour and last time it is online Whether the time difference of exchange hour is more than preset time period, is then to send consumption refusal respond to terminal device, terminates;Otherwise hold Row step 116;
In the present embodiment, preset time period is 12 months;
For example, 00 divide 50 seconds when the last transaction time that smart card is got is 16 days 15 October in 2015, consumption order In exchange hour 00 divide 12 seconds when being 16 days 16 December in 2016;When consuming the exchange hour and last time on-line transaction in order Between time difference be more than 12 months, then to terminal device return consumption refusal instruction, otherwise perform step 112;
It should be noted that the preset time in step 115 is consistent with the preset time in step A3;
It should be noted that on-line transaction time last time is specially the smart card the last on-line transaction time, this implementation In example, when smart card carries out on-line transaction, the last time connection transaction preserved in current exchange hour renewal smart card need to be obtained Time.
Step 116, smart card obtain offline transaction sequence number, according to pseudo random number, offline transaction sequence number and terminal transaction sequence Number generation the second process key, using the second process key to dealing money, type of transaction identify, terminating machine number and transaction when Between be encrypted produce the second message authentication code;
Step 117, smart card judge consumption order in the first message authentication code and the second message authentication code it is whether consistent, It is then to perform step 114, otherwise returns to consumption refusal respond to terminal device, terminate;
Step 118, smart card obtain dealing money in being ordered from consumption, and spending amount is deducted from card balance, and will Offline transaction sequence number adds 1;
Step 119, smart card dealing money are encrypted using the second process key the 3rd message authentication code of generation;And To dealing money, type of transaction mark, terminating machine numbering, terminal transaction sequence number, exchange hour encryption generation transaction verification code;
Specifically, smart card uses TAC words key to handing over dealing money, type of transaction mark, terminating machine numbering, terminal Easy sequence number, exchange hour encryption generation transaction verification code;
Step 120, smart card are numbered and merchandised according to offline transaction sequence number, dealing money, type of transaction mark, terminating machine Time updates transaction details;And send the consumption order comprising the 3rd message authentication code and transaction verification code to terminal device and ring Should;
In the present embodiment, it is specially B0A7E9B5 C09A9A59 to consume data field in command response, and wherein B0A7E9B5 is Transaction verification code, C09A9A59 are the 3rd message authentication code;
Step 121, terminal device obtain the 3rd message authentication code from consumption command response, use the first process key pair The 4th message authentication code of generation is encrypted in dealing money;
Step 122, terminal device judge whether the 4th message authentication code and the 3rd message authentication code are consistent, are then to perform step Rapid 123;Otherwise offline transaction fails, and terminates.
Step 123, terminal device are according to dealing money, type of transaction mark, terminating machine numbering, terminal transaction sequence number, friendship Transaction verification code in easy time and consumption command response generates and preserves transaction record, offline transaction success, terminates.
Embodiment 3
The present embodiment provides a kind of offline transaction aging management method, and terminal device is periodically downloaded special from background server There is blacklist;Referring to Fig. 4 and Fig. 5, specifically include:
Step 201, terminal device check whether smart card is already inserted into card reader, are then to perform step 202, otherwise return Step 201;
Step 202, terminal device are sent to smart card selects application request comprising application identifier;
Specifically, the command message form for selecting application request that terminal device is sent is specially:CLA+INS+P1+P2+Lc+ Data+Le;CLA is order classification, and INS is command code, and P1 and P2 are command parameter;Data is order data domain;Lc is life The length of data field is made, Le is the maximum number of byte of desired reply data;
In the present embodiment, terminal device calculation command data field 3F01 length, specially 02;By command type 00, life Make code A4, command parameter 00 00, the length 02 in order data domain, order data domain 3F01 and desired reply data The sequential concatenation of maximum number of byte 00 obtains selecting application request, selects the application request to be specially:00 A4 00 00 02 3F01 00.
Step 203, smart card judge whether to support application corresponding with application identifier, are then to send to send out to terminal device Card row exclusive data;Otherwise choosing is sent to terminal device using failure response to terminate;
Specifically, credit card issuer exclusive data includes:Bank identification symbol, application type mark, credit card issuer application version number, Application Serial Number, using enable the date, using validity date and credit card issuer self-defining data.
In the present embodiment, the credit card issuer exclusive data that terminal device receives is:CFC3C3C5D2D7CDA8 02 01 00112233445566778899 20,161,118 20261118 FFFF, read first character section to the 8th byte and sent out Card row identifier CFC3C3C5D2D7CDA8, read the 9th byte and be applied type identification 02, read the tenth byte and obtain To credit card issuer application version number 01, read the 11st byte to the 20th byte and be applied sequence number 00112233445566778899, the 21st byte of reading is applied to the 24th byte enables the date 20161118, i.e. on November 18th, 2016;Read the 25th byte and be applied to the 28th byte and enable the date 20261118, i.e. on November 18th, 2026;Read the 29th byte to the 30th byte and obtain the self-defined number of credit card issuer According to FFFF.
Step 204, terminal device are sent to smart card obtains the request of on-line transaction time last time;
Step 205, smart card send last time time online to terminal device;
It should be noted that on-line transaction time last time is specially the smart card the last on-line transaction time, this implementation In example, when smart card carries out on-line transaction, the last time connection transaction preserved in current exchange hour renewal smart card need to be obtained Time.
Step 206, terminal device judge whether current exchange hour and the time difference of on-line transaction time last time are more than in advance It is then error handle if the period, terminates, otherwise performs step 207;
In the present embodiment, preset time period is 12 months;
For example, 00 divide 50 seconds when the last transaction time that smart card is got is 16 days 15 October in 2015, current consumption 00 divides 12 seconds when time is 16 days 16 December in 2016;Current exchange hour and the time difference of on-line transaction time last time are more than 12 Individual month, be then error handle, is terminated, and otherwise performs step 207;
It should be noted that the preset time period in step 206 is consistent with the preset time in step A3;
Preferably, terminal device periodically downloads proprietary blacklist and complete blacklist from management system;
Accordingly, when preserving proprietary blacklist and complete blacklist in terminal device, judge currently to disappear in step 206 When the time-consuming and time difference of on-line transaction time last time is more than preset time period, in addition to:Terminal device is obtained according to hair fastener Whether the bank identification symbol and Application Serial Number that row exclusive data includes judge smart card in the complete black of terminal device storage The row of list, it is then error handle, otherwise performs step 208;
The bank identification symbol and Application Serial Number that step 207, terminal device include according to credit card issuer exclusive data judge Smart card whether terminal device storage proprietary blacklist row, be then error handle, terminate, otherwise perform step 208;
It should be noted that when only preserving proprietary blacklist in terminal device, i.e., when only checking proprietary blacklist, step Rapid 206 and the order of step 207 can exchange.
Step 208, terminal device judge whether to support the bank identification symbol in credit card issuer proprietary data;It is then to perform step Rapid 209, otherwise error handle, terminates
Step 209, terminal device judge whether to support on smart card according to application type mark in credit card issuer exclusive data Application, be then execution step 210, otherwise error handle, terminate;
Step 210, terminal device judge whether to support the application representated by the application version number in credit card issuer exclusive data Version, it is then to perform step 211, otherwise error handle, terminates;
The application term of validity of step 211, terminal device in credit card issuer proprietary data judges whether Then terminal device sends initialization consumption order to smart card, and otherwise error handle, terminates;
Specifically, initialization consumption order INITIALIZE FOR PURCHASE are used to initialize consumer sale;Wherein INITIALIZE FOR PURCHASE command message forms are specially:CLA+INS+P1+P2+Lc+Data+Le;CLA is order Classification, INS are command code, and P1 and P2 are command parameter;Data is order data domain;Lc be order data domain length, Le It is the maximum number of byte of desired reply data;
In the present embodiment, the order data domain Data of initialization consumption order is specifically included:Cipher key index number, dealing money Numbered with terminating machine.
In more detail, terminal device is specially to smart card transmission initialization consumption order:Terminal device is by key rope Quotation marks 01, dealing money 00 00 00 64 and the sequential concatenation of terminating machine numbering 00 00 00 00 00 00 obtain order data Domain, calculation command data field length 0B, by command type 80, command code 50, command parameter 01 02, order data length of field 0B, order data domain 01 00,000,064 000000000000 and expectation the reply data sequential concatenation of maximum number of byte 00 obtain Smart card is sent to initialization consumption order, and by obtained initialization consumption order.
Step 212, smart card judge whether to support the cipher key index number provided in initialization consumption order, are then to perform step Rapid 213;Otherwise sending does not support cipher key index to respond, and terminates;
After smart card judges the cipher key index for not supporting to provide in initialization consumption order, to terminal device loopback Cipher key index status word 0X 9403 is not supported, terminates off-line consumption;
Step 213, smart card judge whether card balance is more than or equal in initialization consumption order and provide trade gold Volume, be then execution step 214, otherwise send card Sorry, your ticket has not enough value response, terminate;
Returned when smart card judges that card balance is less than the dealing money provided in initialization consumption order to terminal device Card feed Sorry, your ticket has not enough value status word 0X 9401, terminate off-line consumption;
Step 214, smart card generation pseudo random number, and current offline transaction sequence number is obtained, send and include to terminal device The initialization consumption response of offline transaction sequence number and pseudo random number;
The initialization response data that terminal device receives in the present embodiment are specially:00003A98 0000 000000 01 00 CD701726, read first character section to the 4th byte and obtain electronic purse balance amount 00003A98;Read the 5th Byte to the 6th byte obtains offline transaction sequence number 0000;Read the 7th byte to the 9th byte and obtain the limit of overdrawn account 000000;Read the tenth byte and obtain key version number 01;Read the 11st byte and obtain algorithm mark 00;Read the tenth Two bytes to the 15th byte obtains the pseudo random number CD701726 of smart card generation.
Step 215, terminal device obtain terminal transaction sequence number, according to pseudo random number, offline transaction sequence number and terminal transaction The process key of serial number gencration first;
The generation method of first process key is specially:Terminal device is by pseudo random number, offline transaction sequence number and terminal Most latter two byte order splicing of sequence number;Recycle consumer sub-cipher key DPK that spliced data are disperseed to obtain with the One process key;
Step 216, terminal device using the first process key to dealing money, type of transaction identify, terminating machine numbering and Exchange hour, which is encrypted, produces the first message authentication code;
Specifically, terminal device is by dealing money, type of transaction mark, terminating machine is numbered and exchange hour sequential concatenation, Spliced data are encrypted using the first process key to obtain encryption data, preceding four bytes of encryption data are first Message authentication code;
Step 217, terminal device are sent to smart card includes terminal transaction sequence number, exchange hour and the first message authentication code Consumption order;
Specifically, consumption order DEBIT FOR PURCHASE are used for consumer sale;Wherein DEBIT FOR PURCHASE Command message form is specially:CLA+INS+P1+P2+Lc+Data+Le;CLA is order classification, and INS is command code, P1 and P2 is command parameter;Data is order data domain;Lc is the length in order data domain, and Le is the maximum word of desired reply data Joint number;
The order data domain of consumption order specifically includes:Terminal transaction sequence number, exchange hour and the first message authentication code MAC1。
Specifically, terminal device is by terminal transaction sequence number 00000001, exchange hour 20161216 in the present embodiment 00 divides 12 seconds and the first message authentication code E599F35208 sequential concatenations are ordered during 160012 i.e. 16 days 16 December in 2016 Make data field, calculation command data field length 0F;By command type 80, command code 54, command parameter 01 00, order data Length of field 0F, the E599F35208 of order data domain 00,000,001 20,161,216 160012 and desired reply data are most The big sequential concatenation of byte number 00 obtains consumption order, and consumption order is specially:80 54 01 00 0F 00000001 20161216 160012 E599F35208 00。
Step 218, smart card obtain offline transaction sequence number, according to pseudo random number, offline transaction sequence number and terminal transaction sequence Number generation the second process key, using the second process key to dealing money, type of transaction identify, terminating machine number and transaction when Between be encrypted produce the second message authentication code;
Step 219, smart card judge consumption order in the first message authentication code and the second message authentication code it is whether consistent, It is then to perform step 214, otherwise returns to consumption refusal respond to terminal device, terminate;
Step 220, smart card obtain dealing money in being ordered from consumption, and spending amount is deducted from card balance, and will Offline transaction sequence number adds 1;
Step 221, smart card dealing money are encrypted using the second process key the 3rd message authentication code of generation;And To dealing money, type of transaction mark, terminating machine numbering, terminal transaction sequence number, exchange hour encryption generation transaction verification code;
Specifically, smart card uses TAC words key to handing over dealing money, type of transaction mark, terminating machine numbering, terminal Easy sequence number, exchange hour encryption generation transaction verification code;
Step 222, smart card are numbered and merchandised according to offline transaction sequence number, dealing money, type of transaction mark, terminating machine Time updates transaction details;And send the consumption order comprising the 3rd message authentication code and transaction verification code to terminal device and ring Should;
In the present embodiment, it is specially B0A7E9B5 C09A9A59 to consume data field in command response, and wherein B0A7E9B5 is Transaction verification code, C09A9A59 are the 3rd message authentication code;
Step 223, terminal device obtain the 3rd message authentication code from consumption command response, use the first process key pair The 4th message authentication code of generation is encrypted in dealing money;
Step 224, terminal device judge whether the 4th message authentication code and the 3rd message authentication code are consistent, are then to perform step Rapid 225;Otherwise offline transaction fails, and terminates.
Step 225, terminal device are according to dealing money, type of transaction mark, terminating machine numbering, terminal transaction sequence number, friendship Transaction verification code in easy time and consumption command response generates and preserves transaction record, offline transaction success, terminates.
Embodiment 4
The present embodiment provides a kind of device of offline transaction prescriptive jurisdiction, referring to Fig. 6, including:
Acquisition module 11:For obtaining the Application Serial Number of smart card, it is additionally operable to obtain last time online friendship from smart card The easy time;
It should be noted that on-line transaction time last time that acquisition module is got is specially the last connection of smart card Machine exchange hour.
Memory module 12, for storing proprietary blacklist;
First judge module 13, during Application Serial Number for getting smart card when acquisition module 11, judge to apply sequence Whether row number stores the row of 12 proprietary blacklist in memory module;
Second judge module 14, for judging Application Serial Number not in the row of proprietary blacklist when the first judge module 11 When, judge the current consumption time and the time difference of on-line transaction time last time that acquisition module 11 is got whether be more than it is default Value;
Error handling module 15, for entering when the first judge module 13 judges Application Serial Number in the row of proprietary blacklist Row error handle;It is additionally operable to when the second judge module 14 judges that the last time that current consumption time and acquisition module 11 are got is online The time difference of exchange hour carries out error handle when being more than preset value;
Sending module 16, for judging current consumption time and the last time that acquisition module is got when the second judge module 14 When the time difference of on-line transaction time is not more than preset value, initialization consumption order is sent to smart card;It is additionally operable to smart card Transmission includes the first Package authentication of terminal transaction sequence number, current exchange hour and the generation of the first message authentication code generation module 18 The consumption order of code;
Command response is consumed in receiving module 17, the initialization for receiving smart card transmission;It is additionally operable to receive smart card hair The consumption command response sent;
First message authentication code generation module 18, for when receiving module 17 receive initialization consumption response when, according to Pseudo random number and offline transaction sequence number in initialization consumption response generate the first process key, use the first process key pair Dealing money, type of transaction mark, terminating machine numbering and exchange hour are encrypted and produce the first message authentication code;
Specifically, the first Package authentication module 18, the initialization specifically for receiving smart card transmission when receiving module During consumption response, pseudo random number and offline transaction sequence number in initialization consumption response generate the first process key, will Dealing money, type of transaction mark, terminating machine numbering and exchange hour sequential concatenation, using the first process key to spliced Data are encrypted to obtain encryption data, using preceding four bytes of encryption data as the first message authentication code.
3rd judge module 19, for when receiving module 17 receives consumption command response, judging to consume command response In the second message authentication code it is whether effective;
Transaction record generation module 20, for judging the second message mirror in consumption command response when the 3rd judge module 17 When other code is effective, offline transaction success, transaction record is generated;It is additionally operable to when the 3rd judge module 19 is judged in consumption command response The second message authentication code it is invalid when, offline transaction failure, generate transaction record.
Specifically, the 3rd judge module 19 specifically includes:
Message authentication code generates submodule, for when receiving module 17 receives consumption command response, being ordered from consumption The second message authentication code is obtained in response, dealing money is encrypted using the first process key the 3rd Package authentication of generation Code;
Judging submodule, for judging to consume the second message authentication code in command response and message authentication code generation submodule Whether the 3rd message authentication code of block generation is consistent;
Accordingly, transaction record generation module 20, for judging the second report in consumption command response when judging submodule When literary authentication code is consistent with the 3rd message authentication code of message authentication code generation submodule generation, offline transaction success, generation is handed over Easily record;It is additionally operable to judge the second message authentication code and message authentication code generation in consumption command response when judging submodule When 3rd message authentication code of module generation is inconsistent, offline transaction failure, transaction record is generated.
Preferably, memory module 12, it is additionally operable to store complete blacklist;
Accordingly, the device also includes:4th judge module, for judging Application Serial Number not when the first judge module 13 In the row of proprietary blacklist, judge Application Serial Number whether memory module 12 store complete blacklist row;
Second judge module 14, for judging Application Serial Number in the complete of the storage of memory module 12 when the 4th judge module During the row of whole blacklist, judge the current consumption time and the time difference of on-line transaction time last time that acquisition module 11 is got is It is no to be more than preset value;
Error handling module 15, for judge that Application Serial Number stores in memory module 12 complete when the 4th judge module Error handle is carried out during the row of blacklist.
It should be noted that the proprietary blacklist that memory module 12 stores is used to storing complete blacklist and reports the loss the time and be in Blacklist in preset time period;When a length of preset value of preset time period.
Preferably, the device includes:Download module, for proprietary blacklist periodically to be obtained and preserved from management system, Or for proprietary blacklist and complete blacklist periodically to be obtained and preserved from management system.
In more detail, download module, for when device has online condition, proprietary black name to be obtained from management system It is single, and proprietary blacklist is saved in memory module 12;Or for when device has online condition, being obtained from management system Proprietary blacklist and complete blacklist are taken, and proprietary blacklist and complete blacklist are stored in memory module 12.
Optionally, when device does not include the second judge module, sending module, specifically for sentencing when the first judge module 13 Application Serial Number is determined not in the row of proprietary blacklist, and initialization consumption order is sent to smart card;It is additionally operable to send out to smart card Send and include terminal transaction sequence number, the first message authentication code of current exchange hour and the generation of the first message authentication code generation module 18 Consumption order;
When smart card receive device transmission consumption order when, judge consumption order in consumption time and last time it is online Whether the time difference of exchange hour is more than preset time period, is to carry out error handle, terminates;Otherwise consumption life is returned to device Order response.
Error handling module, it is aobvious for being reported an error when the first judge module judges Application Serial Number in the row of proprietary blacklist Show or report an error and produce prompt tone;It is additionally operable to when the second judge module judges what current consumption time and acquisition module were got The time difference of on-line transaction time last time reports an error when being more than preset value shows or reports an error and produce prompt tone.
Preferably, sending module 16, it is additionally operable to send to smart card and selects application request comprising application identifier;
Receiving module 17, it is additionally operable to receive the credit card issuer proprietary data that smart card is sent, credit card issuer proprietary data includes The Application Serial Number of smart card;
Acquisition module 11:Should specifically for obtain smart card in the credit card issuer proprietary data that is received from receiving module 17 Use sequence number.
In more detail, specifically included in the credit card issuer proprietary data that receiving module 17 receives:Bank identification symbol, answer With type identification, credit card issuer application version number, Application Serial Number, using enabling the date, made by oneself using validity date and credit card issuer Adopted data.
Preferably, the device includes:5th judge module, for judging whether to support the hair fastener that receiving module 17 receives Bank identification symbol in row proprietary data;
6th judge module, for judging to support the proprietary number of credit card issuer that receiving module 17 receives when the 5th judge module When bank identification in accords with, judge whether the application type mark in the credit card issuer proprietary data that support receiving module receives Know and judge whether to support the application on smart card;
7th judge module, in the credit card issuer proprietary data that is received when the 6th judge module according to receiving module 17 Application type mark when judging to support the application on smart card, judge whether to support that the credit card issuer that receives of receiving module is proprietary The application version representated by application version number in data;
8th judge module, the credit card issuer for judging to support receiving module 17 to receive when the 7th judge module are equipped with number During application version representated by the application version number in, the application in the credit card issuer application data received according to receiving module The term of validity judges whether before the deadline;
Acquisition module 11, specifically for the credit card issuer application data received when the 8th judge module according to receiving module 17 In the application term of validity before the deadline when, obtain Application Serial Number in the credit card issuer data received from receiving module;
Error handling module 15, for judging not supporting that the credit card issuer that receiving module 17 receives is special when the 5th judge module Error handle is carried out when having the symbol of the bank identification in data;It is additionally operable to when the 6th judge module receives according to receiving module 17 Credit card issuer proprietary data in application type mark judge do not support to carry out error handle during the application on smart card;It is additionally operable to When the credit card issuer that the 7th judge module judges not supporting receiving module 17 to receive is equipped with representated by the application version number in data Application version when carry out error handle;It is additionally operable to the credit card issuer application received when the 8th judge module according to receiving module 17 The application term of validity in data not before the deadline when carry out error handle.
The foregoing is only a specific embodiment of the invention, but protection scope of the present invention is not limited thereto, any Those familiar with the art the invention discloses technical scope in, change or replacement can be readily occurred in, should all be contained Cover within protection scope of the present invention.Therefore, protection scope of the present invention described should be defined by scope of the claims.

Claims (26)

  1. A kind of 1. offline transaction aging management method, it is characterised in that including:
    Step S1, when terminal device gets the Application Serial Number of smart card, judge the Application Serial Number whether described The row of the proprietary blacklist of terminal device storage, are to carry out error handle;Otherwise step S2 is performed;
    Step S2, described terminal device obtains on-line transaction time last time from the smart card, and judges the current consumption time Whether it is more than preset value with the time difference of the last time on-line transaction time, is to carry out error handle;Otherwise to the intelligence Card sends initialization consumption order, performs step S3;
    Step S3, described terminal device receives the initialization consumption response that the smart card is sent, and is consumed according to the initialization Pseudo random number and offline transaction sequence number in response generate the first process key, using first process key to trade gold Volume, type of transaction mark, terminating machine numbering and exchange hour are encrypted and produce the first message authentication code, and to the smart card Send the consumption order for including terminal transaction sequence number, the exchange hour and first message authentication code;
    Step S4, described terminal device receives the consumption command response that the smart card is sent, and judges the consumption command response In the second message authentication code it is whether effective, be then offline transaction success, generate transaction record;Otherwise offline transaction fails, raw Into transaction record.
  2. 2. the method as described in claim 1, it is characterised in that when the terminal device judges current consumption time and last time connection The time difference of machine exchange hour is more than after preset value, in addition to:Whether terminal device judges the Application Serial Number in terminal The row of the complete blacklist of equipment storage, are to carry out error handle, otherwise perform step S3.
  3. 3. the method as described in right will go 2, it is characterised in that the proprietary blacklist is used to store to report the loss in complete blacklist The blacklist that time is in preset time period;When a length of preset value of the preset time period.
  4. 4. the method as described in claim 1, it is characterised in that methods described also includes:The terminal device is periodically from management Obtained in system and preserve proprietary blacklist or the terminal device is periodically obtained from the management system and preserved proprietary Blacklist and complete blacklist.
  5. 5. the method as described in claim 1, it is characterised in that methods described also includes:When the terminal device have it is online During condition, proprietary blacklist and complete blacklist are downloaded from management system or proprietary blacklist is downloaded from management system.
  6. 6. the method as described in claim 1, it is characterised in that the step S2 is replaced with:The terminal device is to the intelligence Can card transmission initialization consumption order;
    After the step S3, also include before S4:The smart card judges consumption time and last time in the consumption order Whether the time difference of on-line transaction time is more than preset time period, is to carry out error handle, terminates;Otherwise set to the terminal It is standby to return to consumption command response, perform step S4.
  7. 7. the method as described in claim 1, it is characterised in that the last time on-line transaction time is specially smart card nearest one The secondary on-line transaction time.
  8. 8. the method as described in claim 1, it is characterised in that the error handle specifically includes:Terminal device reports an error display Or report an error and produce prompt tone.
  9. 9. the method as described in claim 1, it is characterised in that also include before the step S1:The terminal device is to intelligence It can block to send and select application request comprising application identifier;The credit card issuer proprietary data returned etc. smart card to be received, the hair Card row proprietary data includes the Application Serial Number of smart card.
  10. 10. method as claimed in claim 9, it is characterised in that specifically included in the credit card issuer proprietary data:Hair fastener rower Know symbol, application type mark, credit card issuer application version number, Application Serial Number, using enable the date, using validity date and hair fastener Row self-defining data.
  11. 11. method as claimed in claim 10, it is characterised in that also include before the step S1:
    Step 101, the terminal device judge whether to support the bank identification in the credit card issuer proprietary data to accord with;It is Step 102 is then performed, otherwise carries out error handle;
    Step 102, the terminal device application type mark according to the credit card issuer exclusive data judge whether to support Application on smart card, it is then to perform step 103, otherwise carries out error handle;
    Step 103, the terminal device judge whether to support application version institute's generation in the credit card issuer exclusive data The application version of table, it is then to perform step 104, otherwise carries out error handle;
    The application term of validity of step 104, the terminal device in the credit card issuer proprietary data judges whether having In the effect phase, it is then to perform step S1, otherwise carries out error handle.
  12. 12. the method as described in claim 1, it is characterised in that the step S3 is specially:The terminal device receives intelligence The initialization consumption response that card is sent, pseudo random number and offline transaction sequence number generation first in initialization consumption response Process key, it is close using the first process by dealing money, type of transaction mark, terminating machine numbering and exchange hour sequential concatenation Key is encrypted to obtain encryption data to spliced data, using preceding four bytes of encryption data as the first Package authentication Code.
  13. 13. the method as described in claim 1, it is characterised in that the step S4 is specifically included:
    Step 201, the terminal device receive the consumption command response that smart card is sent, and are obtained from the consumption command response Second message authentication code, dealing money is encrypted using first process key the 3rd message authentication code of generation;
    Step 202, terminal device judge whether the 3rd message authentication code and second message authentication code are consistent, are then de- Machine is merchandised successfully, generates transaction record;Otherwise offline transaction fails, and generates transaction record.
  14. A kind of 14. device of offline transaction prescriptive jurisdiction, it is characterised in that including:
    Acquisition module:For obtaining the Application Serial Number of smart card, it is additionally operable to obtain on-line transaction time last time from smart card;
    Memory module, for storing proprietary blacklist;
    First judge module, during Application Serial Number for getting smart card when the acquisition module, judge described to apply sequence Row number whether the memory module storage proprietary blacklist row;
    Second judge module, for when first judge module judge the Application Serial Number not the proprietary blacklist it During row, judge the current consumption time and whether the time difference of last time on-line transaction time that the acquisition module is got is big In preset value;
    Error handling module, for judging row of the Application Serial Number in the proprietary blacklist when first judge module Shi Jinhang error handles;It is additionally operable to when second judge module judges that the current consumption time and the acquisition module obtain To time difference of the last time on-line transaction time be more than preset value when carry out error handle;
    Sending module, for judging what the current consumption time and the acquisition module were got when second judge module When the time difference of the last time on-line transaction time is not more than preset value initialization consumption order is sent to the smart card;Also use Include terminal transaction sequence number in being sent to the smart card, what current exchange hour and the first message authentication code generation module generated The consumption order of first message authentication code;
    Receiving module, command response is consumed for receiving the initialization that the smart card is sent;It is additionally operable to receive the smart card The consumption command response of transmission;
    The first message authentication code generation module, for when the receiving module receive it is described initialization consumption response when, Pseudo random number and offline transaction sequence number in the initialization consumption response generate the first process key, use described the One process key is encrypted to dealing money, type of transaction mark, terminating machine numbering and exchange hour and produces the first message mirror Other code;
    3rd judge module, for when the receiving module receives the consumption command response, judging to consume command response In the second message authentication code it is whether effective;
    Transaction record generation module, for judging the second message mirror in the consumption command response when the 3rd judge module When other code is effective, offline transaction success, transaction record is generated;It is additionally operable to when the 3rd judge module judges the consumption order When the second message authentication code in response is invalid, offline transaction failure, transaction record is generated.
  15. 15. device as claimed in claim 14, it is characterised in that
    The memory module, it is additionally operable to store complete blacklist;
    Described device also includes:4th judge module, for judging that the Application Serial Number does not exist when first judge module During the row of the proprietary blacklist, judge the Application Serial Number whether the memory module storage the complete blacklist Row;
    Second judge module, for judging the Application Serial Number not in the memory module when the 4th judge module During the row of the complete blacklist of storage, judge the current consumption time and last time that the acquisition module is got is online Whether the time difference of exchange hour is more than preset value;
    The error handling module, for judging that the Application Serial Number is deposited in the memory module when the 4th judge module Error handle is carried out during the row of the complete blacklist of storage.
  16. 16. the device as described in right will go 15, it is characterised in that the proprietary blacklist of the memory module storage is used for Store the blacklist that the complete blacklist is reported the loss the time and is in preset time period;The preset time period when it is a length of described Preset value.
  17. 17. device as claimed in claim 14, it is characterised in that also include:Download module, for periodically from management system Proprietary blacklist is obtained, and the proprietary blacklist is stored in memory module, or for periodically being obtained from management system Proprietary blacklist and complete blacklist, and proprietary blacklist and complete blacklist are stored in memory module.
  18. 18. device as claimed in claim 14, it is characterised in that also include:Download module, for there is connection when described device During machine condition, obtained from management system and preserve proprietary blacklist;Or for when described device has online condition, from Obtained in the management system and preserve proprietary blacklist and complete blacklist.
  19. 19. device as claimed in claim 14, it is characterised in that described when described device does not include the second judge module Sending module, specifically for judging the Application Serial Number not in the row of the proprietary blacklist when first judge module When, send initialization consumption order to the smart card;It is additionally operable to send to the smart card and includes terminal transaction sequence number, currently The consumption order of exchange hour and first message authentication code of the first message authentication code generation module generation;
    When the smart card receives the consumption order of described device transmission, when judging the consumption in the consumption order Between and time difference of on-line transaction time last time whether be more than preset time period, be to carry out error handle, end;Otherwise to institute State device and return to consumption command response.
  20. 20. device as claimed in claim 14, it is characterised in that the last time on-line transaction that the acquisition module is got Time is specially the smart card the last on-line transaction time.
  21. 21. device as claimed in claim 14, it is characterised in that the error handling module, for when the described first judgement Module judges that the Application Serial Number reports an error in the row of the proprietary blacklist and shows or report an error and produce prompt tone;Also use In judging the last time online friendship that the current consumption time and the acquisition module get when second judge module The time difference of easy time reports an error when being more than preset value and shows or report an error and produce prompt tone.
  22. 22. device as claimed in claim 14, it is characterised in that the sending module, be additionally operable to send to the smart card Application request is selected comprising application identifier;
    The receiving module, it is additionally operable to receive the credit card issuer proprietary data that the smart card is sent, the credit card issuer proprietary data Include the Application Serial Number of smart card;
    The acquisition module:Specifically for obtaining smart card in the credit card issuer proprietary data that is received from the receiving module Application Serial Number.
  23. 23. device as claimed in claim 22, it is characterised in that the proprietary number of the credit card issuer that the receiving module receives Specifically included in:Bank identification symbol, application type mark, credit card issuer application version number, Application Serial Number, using enabling day Phase, using validity date and credit card issuer self-defining data.
  24. 24. device as claimed in claim 23, it is characterised in that also include:
    5th judge module, for the institute in the credit card issuer proprietary data that judges whether to support the receiving module to receive State bank identification symbol;
    6th judge module, for judging to support the credit card issuer that the receiving module receives when the 5th judge module During bank identification symbol in proprietary data, the credit card issuer for judging whether to support the receiving module to receive is proprietary Application type mark in data judges whether to support the application on smart card;
    7th judge module, the credit card issuer for being received when the 6th judge module according to the receiving module are proprietary When application type mark in data judges to support the application on smart card, judge whether to support the receiving module to receive To the credit card issuer proprietary data in the application version number representated by application version;
    8th judge module, for judging to support the credit card issuer that the receiving module receives when the 7th judge module During equipped with application version representated by the application version number in data, the hair fastener that is received according to the receiving module The application term of validity in row application data judges whether before the deadline;
    The acquisition module, specifically for the credit card issuer received when the 8th judge module according to the receiving module The application term of validity in proprietary data before the deadline when, in the credit card issuer data received from the receiving module Obtain Application Serial Number;
    The error handling module, described in judging not support that the receiving module receives when the 5th judge module The bank identification in credit card issuer proprietary data carries out error handle when according with;Be additionally operable to when the 6th judge module according to Application type mark in the credit card issuer proprietary data that the receiving module receives judges not support on smart card Application when carry out error handle;It is additionally operable to the institute for not supporting the receiving module to receive when the 7th judge module judgement Error handle is carried out when stating the application version representated by the application version number that credit card issuer is equipped with data;It is additionally operable to when described The application term of validity in the credit card issuer application data that 8th judge module receives according to the receiving module does not exist Error handle is carried out when in the term of validity.
  25. 25. device as claimed in claim 14, it is characterised in that the first Package authentication module, specifically for when described When receiving module receives the initialization consumption response that the smart card is sent, in the initialization consumption response it is pseudo- with Machine number and offline transaction sequence number generate the first process key, and by dealing money, type of transaction mark, terminating machine is numbered and transaction Time sequencing is spliced, and spliced data are encrypted to obtain encryption data using first process key, will encrypt number According to preceding four bytes as the first message authentication code.
  26. 26. device as claimed in claim 14, it is characterised in that the 3rd judge module specifically includes:
    Message authentication code generates submodule, for when the receiving module receives the consumption command response, disappearing from described The second message authentication code is obtained in expense command response, dealing money is encrypted generation the 3rd using first process key Message authentication code;
    Judging submodule, for judging that the second message authentication code in the consumption command response generates with the message authentication code Whether the 3rd message authentication code of submodule generation is consistent;
    The transaction record generation module, for judging the second message in the consumption command response when the judging submodule When authentication code is consistent with the 3rd message authentication code of message authentication code generation submodule generation, offline transaction success, generation Transaction record;It is additionally operable to when the judging submodule judges the second message authentication code in the consumption command response and the report When 3rd message authentication code of literary authentication code generation submodule generation is inconsistent, offline transaction failure, transaction record is generated.
CN201710830874.3A 2017-09-15 2017-09-15 Offline transaction aging management method and device Active CN107730253B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710830874.3A CN107730253B (en) 2017-09-15 2017-09-15 Offline transaction aging management method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710830874.3A CN107730253B (en) 2017-09-15 2017-09-15 Offline transaction aging management method and device

Publications (2)

Publication Number Publication Date
CN107730253A true CN107730253A (en) 2018-02-23
CN107730253B CN107730253B (en) 2020-08-07

Family

ID=61206350

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710830874.3A Active CN107730253B (en) 2017-09-15 2017-09-15 Offline transaction aging management method and device

Country Status (1)

Country Link
CN (1) CN107730253B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110020864A (en) * 2018-12-20 2019-07-16 阿里巴巴集团控股有限公司 Recognition methods, device and the equipment traded extremely under weak net environment
CN112241881A (en) * 2019-07-17 2021-01-19 天地融科技股份有限公司 Off-line transaction method and system based on electronic cash
WO2021008326A1 (en) * 2019-07-17 2021-01-21 天地融科技股份有限公司 Electronic cash-based offline transaction method and system
CN113837735A (en) * 2021-08-20 2021-12-24 中国人民银行数字货币研究所 Transaction method and device for digital currency chip card

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110066512A1 (en) * 2009-04-21 2011-03-17 Kanngard Lars O Applications of Stored Value Card
CN102073958A (en) * 2009-11-25 2011-05-25 天津中兴软件有限责任公司 System and method for implementing mobile payment
US8407082B2 (en) * 2007-01-30 2013-03-26 Visa U.S.A. Inc. Aggregation of validated transactions for settlement
CN103823761A (en) * 2014-03-09 2014-05-28 林虎 Method for increasing blacklist terminal capacity and retrieval speed
CN104978659A (en) * 2015-07-02 2015-10-14 兰州兰大小精灵新技术有限责任公司 Mobile phone consumption terminal
CN106339874A (en) * 2016-08-11 2017-01-18 飞天诚信科技股份有限公司 Online transaction method, visual financial IC card, client and server
CN106355404A (en) * 2016-08-26 2017-01-25 武汉天喻信息产业股份有限公司 Debit credit transaction system with security loophole protection mechanism and method thereof
CN106412797A (en) * 2015-07-31 2017-02-15 中国移动通信集团公司 Service processing method and apparatus based on near field communication (NFC)

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8407082B2 (en) * 2007-01-30 2013-03-26 Visa U.S.A. Inc. Aggregation of validated transactions for settlement
US20110066512A1 (en) * 2009-04-21 2011-03-17 Kanngard Lars O Applications of Stored Value Card
CN102073958A (en) * 2009-11-25 2011-05-25 天津中兴软件有限责任公司 System and method for implementing mobile payment
CN103823761A (en) * 2014-03-09 2014-05-28 林虎 Method for increasing blacklist terminal capacity and retrieval speed
CN104978659A (en) * 2015-07-02 2015-10-14 兰州兰大小精灵新技术有限责任公司 Mobile phone consumption terminal
CN106412797A (en) * 2015-07-31 2017-02-15 中国移动通信集团公司 Service processing method and apparatus based on near field communication (NFC)
CN106339874A (en) * 2016-08-11 2017-01-18 飞天诚信科技股份有限公司 Online transaction method, visual financial IC card, client and server
CN106355404A (en) * 2016-08-26 2017-01-25 武汉天喻信息产业股份有限公司 Debit credit transaction system with security loophole protection mechanism and method thereof

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110020864A (en) * 2018-12-20 2019-07-16 阿里巴巴集团控股有限公司 Recognition methods, device and the equipment traded extremely under weak net environment
CN112241881A (en) * 2019-07-17 2021-01-19 天地融科技股份有限公司 Off-line transaction method and system based on electronic cash
WO2021008326A1 (en) * 2019-07-17 2021-01-21 天地融科技股份有限公司 Electronic cash-based offline transaction method and system
CN113837735A (en) * 2021-08-20 2021-12-24 中国人民银行数字货币研究所 Transaction method and device for digital currency chip card
CN113837735B (en) * 2021-08-20 2023-11-07 中国人民银行数字货币研究所 Transaction method and device for digital currency chip card

Also Published As

Publication number Publication date
CN107730253B (en) 2020-08-07

Similar Documents

Publication Publication Date Title
CN107730253A (en) A kind of offline transaction aging management method and device
US7689826B2 (en) Flexibly loading a tamper resistant module
CN104603809B (en) Promote the system and method for transaction using virtual card on the mobile apparatus
EP0985204B1 (en) Ic card transportation key set
US6488211B1 (en) System and method for flexibly loading in IC card
KR101378180B1 (en) Reader card system and method for reducing an interaction time in contactless transaction
EP0981807B1 (en) Integrated circuit card with application history list
US6687800B1 (en) Chip card comprising means and method for managing a virtual memory and associated communication method
CN102377570B (en) Method and device for generating dynamic passwords
NZ307593A (en) Transaction recovery for electronic money system
CN106557929A (en) Logistics information processing method and processing device
CN100541528C (en) Data revise the method for preventing and data are revised anti-locking system
CN105930179A (en) Method and apparatus for upgrading transaction terminal
CN108763937A (en) A kind of dispatching document generates, dispatching and promotion message processing method and processing device
CN101477661B (en) A kind of digital certificate management method, device and system
CN102779374B (en) The transaction processing method of stored value card and system
CN106022427A (en) An information processing method and system based on two-dimensional codes
CN107318103A (en) Anti- based on Internet of Things SIM card cuts machine method and its system
CN102110334B (en) Device, system and method for processing information
CN102592358A (en) Method, system and device for writing electronic data
CN106022823A (en) An information processing method and system based on two-dimensional codes
CN109064316A (en) A kind of credit card restores the method and device of off-line consumption amount
CN109299603A (en) A kind of guard method of server, system and relevant apparatus
CN106779699A (en) It is a kind of based on randomly update key encryption network booking method of commerce
CN107767146A (en) Processing method, device and the terminal device of favor information

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant