WO2011127687A1 - Non-contact card terminal and abnormal state processing method thereof - Google Patents

Non-contact card terminal and abnormal state processing method thereof Download PDF

Info

Publication number
WO2011127687A1
WO2011127687A1 PCT/CN2010/074167 CN2010074167W WO2011127687A1 WO 2011127687 A1 WO2011127687 A1 WO 2011127687A1 CN 2010074167 W CN2010074167 W CN 2010074167W WO 2011127687 A1 WO2011127687 A1 WO 2011127687A1
Authority
WO
WIPO (PCT)
Prior art keywords
transaction
wallet
smart card
information
terminal
Prior art date
Application number
PCT/CN2010/074167
Other languages
French (fr)
Chinese (zh)
Inventor
张迪
吴中平
雷波
侯晓凡
余海峰
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2011127687A1 publication Critical patent/WO2011127687A1/en

Links

Classifications

    • GPHYSICS
    • G07CHECKING-DEVICES
    • G07FCOIN-FREED OR LIKE APPARATUS
    • G07F7/00Mechanisms actuated by objects other than coins to free or to actuate vending, hiring, coin or paper currency dispensing or refunding apparatus
    • G07F7/08Mechanisms actuated by objects other than coins to free or to actuate vending, hiring, coin or paper currency dispensing or refunding apparatus by coded identity card or credit card or other personal identification means
    • G07F7/0873Details of the card reader
    • G07F7/0893Details of the card reader the card reader reading the card in a contactless manner
    • 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/308Payment architectures, schemes or protocols characterised by the use of specific devices or networks using the Internet of Things
    • 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/32Payment architectures, schemes or protocols characterised by the use of specific devices or networks using wireless devices
    • G06Q20/327Short range or proximity payments by means of M-devices
    • G06Q20/3278RFID or NFC payments by means of M-devices
    • 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/352Contactless payments by cards
    • 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/36Payment architectures, schemes or protocols characterised by the use of specific devices or networks using electronic wallets or electronic money safes
    • G06Q20/367Payment architectures, schemes or protocols characterised by the use of specific devices or networks using electronic wallets or electronic money safes involving electronic purses or money safes
    • G06Q20/3676Balancing accounts
    • GPHYSICS
    • G07CHECKING-DEVICES
    • G07FCOIN-FREED OR LIKE APPARATUS
    • G07F7/00Mechanisms actuated by objects other than coins to free or to actuate vending, hiring, coin or paper currency dispensing or refunding apparatus
    • G07F7/08Mechanisms actuated by objects other than coins to free or to actuate vending, hiring, coin or paper currency dispensing or refunding apparatus by coded identity card or credit card or other personal identification means
    • G07F7/0806Details of the card
    • G07F7/0813Specific details related to card security
    • G07F7/0826Embedded security module

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • Finance (AREA)
  • Computer Security & Cryptography (AREA)
  • Microelectronics & Electronic Packaging (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Computing Systems (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

A non-contact card terminal and an abnormal state processing method thereof are provided, wherein, said card includes an intelligent card, and said method involves: setting and/or backing-up purse information of said intelligent card when said terminal carries out an initialization processing of a trade, setting the trade state of the purse as an initial trade state at least, sequentially updating the trade state of said purse by said terminal during a trade process, recording the trade information of said purse, and recovering normal trade or ending abnormal trade according to said trade state if said terminal or said intelligent card is in abnormal state during said trade process.

Description

一种针对非接触式卡片的终端及其处理异常的方法  Terminal for contactless card and method for processing abnormality thereof
技术领域 Technical field
本发明涉及射频识别应用技术领域, 尤其涉及针对非接触式卡片的终端 及其处理异常的方法。  The present invention relates to the field of radio frequency identification application technologies, and in particular, to a terminal for a contactless card and a method for handling the abnormality thereof.
背景技术 Background technique
目前消费智能卡有很多种,有射频用户身份识别模块( SIM )卡( RFSIM ) , 是可实现中近距离无线通信的手机智能卡; 有非接触式的 CPU卡, 是一种非 接触式的集成电路(IC )卡, 可实现近距离通信, 等等。 此外, 还有一种非 接触式逻辑加密卡, 它与智能卡的区别在于: 在智能卡中, 由于存在一个带 有微处理器 (MPU, Micro-Processor Unit ) 的集成电路, 故除了具有较大的 存储容量外, 还具备一定的数据处理能力, 使用起来数据的安全性更高; 而 非接触式的逻辑加密卡只具有数据存储功能, 不具备数据处理能力, 其安全 性易被破解, 只是由于其成本较低, 故目前尚没有完全被智能卡所替代。  At present, there are many kinds of consumer smart cards, and there is a radio frequency subscriber identity module (SIM) card (RFSIM), which is a mobile phone smart card capable of realizing medium and short range wireless communication; a non-contact type CPU card is a contactless integrated circuit. (IC) card for near field communication, and more. In addition, there is a contactless logic encryption card, which differs from a smart card in that: In a smart card, there is an integrated circuit with a microprocessor (MPU), in addition to having a large storage. In addition to capacity, it also has certain data processing capabilities, and the data is more secure to use; the non-contact logical encryption card only has data storage function, does not have data processing capability, and its security is easily cracked, just because of its The cost is lower, so it has not been completely replaced by smart cards.
随着物联网技术的发展, 射频识别技术的应用场景越来越复杂, 譬如将 智能卡应用于各类消费, 各种智能卡片将会逐步替代原有的非接触式逻辑加 密卡。 同时, 为了满足各种消费需求, 出现了在一张智能卡片中组合钱包的 情况, 譬如在企业中, 员工的智能卡中用于食堂消费的钱包有两个, 一个用 于存放企业每月发放的补贴, 另一个用于存放个人充值金额等。 另外, 还有 一张智能卡中有多种钱包的情况, 譬如用于公交乘车消费的公交卡, 同时可 在一些超市中购物消费等。 在专利 200910092488.4中曾提到智能卡建立多钱 包的应用问题, 但该专利是仅从智能卡的角度讲述如何扩展多钱包。  With the development of the Internet of Things technology, the application scenarios of RFID technology are becoming more and more complex. For example, if smart cards are applied to various types of consumption, various smart cards will gradually replace the original contactless logic encryption cards. At the same time, in order to meet various consumer needs, there has been a situation in which a wallet is combined in a smart card. For example, in an enterprise, there are two wallets for the canteen consumption in the employee's smart card, one for storing the monthly payment of the enterprise. The subsidy, the other is used to store personal recharge amount and so on. In addition, there is a case where there are a variety of wallets in the smart card, such as a bus card used for bus travel, and shopping and consumption in some supermarkets. The application of the smart card to build a multi-money package has been mentioned in the patent 200910092488.4, but the patent only describes how to expand the multi-wallet from the perspective of the smart card.
在现实应用中, 人们常见的运用智能卡进行消费的方式有两种, 一种是 联机交易, 另一种则是脱机交易。 其中, 联机交易的账户信息是存储在后台 服务器, 用户在进行交易时通过智能卡的唯一标识(即智能卡的卡号) , 来 确定其后台服务器上的账户信息, 因此终端无需配备消费安全存取模块 ( PSAM, Purchase Secure Access Module ) ; 脱机交易的账户信息是存储在 智能卡中, 这样就需要在终端上配备 PSAM, 用于对交易中的数据进行安全 认证, 如图 1所示。 由于在进行交易过程中终端无需像联机交易那样与后台 服务器频繁进行交互, 故脱机交易消费的应用范围比联机交易更为广阔。 In real-world applications, there are two common ways to use smart cards for consumption. One is online trading, and the other is offline trading. The account information of the online transaction is stored in the background server, and the user determines the account information on the background server by using the unique identifier of the smart card (ie, the card number of the smart card) when the transaction is performed, so the terminal does not need to be equipped with the consumer security access module ( PSAM, Purchase Secure Access Module); Account information for offline transactions is stored in the smart card, so you need to have PSAM on the terminal to secure the data in the transaction. Certification, as shown in Figure 1. Since the terminal does not need to interact with the background server frequently as in the online transaction during the transaction process, the application range of the offline transaction consumption is wider than the online transaction.
从图 1中可以看出, 非接触式智能卡 1与终端 2通过空口进行通信, 因 为交易涉及到费用支付问题, 所以, 在交易过程中终端需要通过消费安全存 取模块 PSAM21对数据进行安全认证, 交易的所有数据最后会通过网络传输 到后台服务器 3上。  As can be seen from FIG. 1, the contactless smart card 1 communicates with the terminal 2 through the air interface. Since the transaction involves a fee payment problem, the terminal needs to securely authenticate the data through the consumer security access module PSAM21 during the transaction process. All data of the transaction is finally transmitted to the backend server 3 via the network.
非接触式智能卡在进行一次交易通信过程中, 可能会遇到以下问题: 第一, 在消费过程中, 终端工作正常, 但非接触式智能卡可能会异常离 开终端的感应区;  In the process of conducting a transaction communication, the contactless smart card may encounter the following problems: First, during the consumption process, the terminal works normally, but the contactless smart card may abnormally leave the sensing area of the terminal;
此时, 终端通知用户将非接触式智能卡重新放回终端的感应区上, 待终 端重新搜寻到该智能卡, 并确认为是刚刚所使用的智能卡后, 通过 PSAM的 智能卡验证命令从智能卡获取验证数据所需的第二报文鉴别码 ( MAC2 , Message Authentication Code 2 )信息, 以验证交易的合法性, 如果 MAC2信 息验证成功, 说明交易已发生, 即在智能卡的账户信息中相应的款项已扣, 此时终端将该记录存储到终端上的数据库 22中, PSAM将生成新的交易流水 号, 完成交易。  At this time, the terminal notifies the user to put the contactless smart card back into the sensing area of the terminal. After the terminal re-searches the smart card and confirms that it is the smart card just used, the smart card verification command is used to obtain the verification data from the smart card. The required second message authentication code (MAC2, Message Authentication Code 2) information is used to verify the legality of the transaction. If the MAC2 information is successfully verified, the transaction has occurred, that is, the corresponding payment has been deducted in the account information of the smart card. At this point, the terminal stores the record in the database 22 on the terminal, and the PSAM will generate a new transaction serial number to complete the transaction.
第二, 在消费过程中, 终端可能会突然断电;  Second, during the consumption process, the terminal may suddenly lose power;
此时,如果按照上述智能卡异常离开终端的感应区的方式进行防拔处理, 则无法通过 PSAM的验证,原因是原 PSAM的初始化信息已在终端断电时丟 失。 并且, 不但当前的交易无法确定, 同时组合钱包交易到哪一步也无法确 定。  At this time, if the smart card is abnormally removed from the sensing area of the terminal, the PSAM authentication cannot be performed because the original PSAM initialization information has been lost when the terminal is powered off. Moreover, not only the current transaction cannot be determined, but also the step in which the wallet transaction is combined cannot be determined.
在此, 终端防拔处理是指在交易过程中出现交易异常结束时, 保证交易 的一致性的做法。 交易的一致性是指通过终端的处理使得智能卡上的交易信 息和后台服务器上的交易信息一致。  Here, the terminal pull-out processing refers to the practice of ensuring the consistency of the transaction when the transaction ends abnormally during the transaction. The consistency of the transaction means that the transaction information on the smart card is consistent with the transaction information on the background server through the processing of the terminal.
在专利 CN01130114.7和专利 CN200510025030.9中, 描述了非接触式逻 辑加密卡的防拔处理方法, 但由于其存在以下问题仍无法解决上述在交易过 程出现异常而导致交易无法继续进行的根本问题:  In the patent CN01130114.7 and the patent CN200510025030.9, the method of preventing the pull-out of the non-contact logic encryption card is described, but the above-mentioned problem still cannot solve the above-mentioned fundamental problem that the transaction cannot be continued due to the abnormality in the transaction process. :
( 1 )这两项专利描述的都是非接触式的逻辑加密卡的防拔处理方法或者 数据恢复方法, 而不是智能卡或射频 SIM卡的防拔处理方法, 由于两类卡的 结构的不同, 故前者的处理方式不能移植到后者。 (1) Both of these patents describe the method of preventing and removing the non-contact logical encryption card or The data recovery method, rather than the method of preventing or removing the smart card or the radio frequency SIM card, cannot be transplanted to the latter because the structure of the two types of cards is different.
( 2 )这两项专利仅讲述的是对非接触式逻辑加密卡因晃动移出终端的感 应区域后所导致的交易异常进行的处理, 而并不包括对于终端在上电情况下  (2) These two patents only deal with the transaction abnormality caused by the contactless logical encryption card being shaken out of the sensory area of the terminal, and does not include the case that the terminal is powered on.
( 3 )这两项专利均未提到一张智能卡具有多钱包消费的终端的防拔处理 方法。 (3) Neither of these patents mentions a method for preventing and removing the terminal of a smart card having multi-wallet consumption.
由此可见, 现有的非接触式智能卡的终端及其处理异常的方法需要加以 改进, 使其能够针对智能卡、 终端的异常进行相应的防拔处理, 且能够方便 地适应于一"" ^多钱包交易的终端中。  It can be seen that the existing non-contact smart card terminal and the method for handling the abnormality need to be improved, so that it can perform corresponding anti-drawing processing for the abnormality of the smart card and the terminal, and can be easily adapted to one "" In the terminal of the wallet transaction.
发明内容 Summary of the invention
本发明所要解决的技术问题是提供一种针对非接触式卡片的终端及其处 理异常的方法, 能够针对智能卡、 终端的异常进行防拔处理。  The technical problem to be solved by the present invention is to provide a terminal for a contactless card and a method for handling the abnormality thereof, which can perform an anti-drawing process for an abnormality of the smart card or the terminal.
为了解决上述技术问题, 本发明提供了一种针对非接触式卡片的终端处 理异常的方法, 其中, 所述卡片包括智能卡, 所述方法包括:  In order to solve the above technical problem, the present invention provides a method for processing an abnormality of a terminal of a contactless card, wherein the card includes a smart card, and the method includes:
所述终端在进行交易的初始化处理时, 设置和 /或备份所述智能卡的钱包 信息, 并至少将钱包的交易状态设置为交易初始; 以及  The terminal sets and/or backs up the wallet information of the smart card when the transaction is initialized, and sets at least the transaction status of the wallet as the transaction initial;
所述终端在进行交易过程中逐步更新所述钱包的交易状态, 并记录所述 钱包的交易信息; 若在所述交易过程中出现所述终端或所述智能卡异常, 则 根据所述交易状态恢复正常的交易或终止异常的交易。  The terminal gradually updates the transaction status of the wallet during the transaction process, and records the transaction information of the wallet; if the terminal or the smart card is abnormal during the transaction, the terminal is restored according to the transaction status A normal transaction or termination of an abnormal transaction.
在所述设置和 /或备份所述智能卡的钱包信息的步骤中,  In the step of setting and/or backing up the wallet information of the smart card,
通过树形数据结构设置和 /或备份所述智能卡内的钱包信息, 所述树形结 构的根节点为钱包类型, 所述根节点的子节点依次为一个或多个钱包类型, 每一个钱包类型包括一个或 n个钱包, 其中 n为大于 1的整数; 所述智能卡 内的钱包信息除所述钱包的交易状态外, 还包括所述钱包类型、钱包流水号、 智能卡所需的钱包个数、 总交易金额以及智能卡标识信息中的一种或多种。  Setting and/or backing up wallet information in the smart card by a tree data structure, the root node of the tree structure is a wallet type, and the child nodes of the root node are one or more wallet types in turn, and each wallet type Included in the wallet information, the wallet information in the One or more of the total transaction amount and smart card identification information.
所述终端在进行交易过程中逐步更新所述钱包的交易状态的步骤包括: 在将所述交易状态设置为交易开始后, 向所述智能卡发送交易请求, 并 在对该智能卡安全验证通过后, 接收该智能卡返回的交易响应; 以及 The step of the terminal gradually updating the transaction status of the wallet during the transaction process includes: After setting the transaction status to start the transaction, sending a transaction request to the smart card, and after receiving the security verification of the smart card, receiving a transaction response returned by the smart card;
所述终端将所述交易响应中的第二报文鉴别码 MAC2信息传输给消费安 全存取模块 PSAM, 根据所述 PSAM返回的交易合法性的验证结果, 将钱包 的交易状态更新为交易完成。  The terminal transmits the second message authentication code MAC2 information in the transaction response to the consumption security access module PSAM, and updates the transaction status of the wallet to completion of the transaction according to the verification result of the transaction legality returned by the PSAM.
在所述接收该智能卡返回的交易响应的步骤之前, 所述方法还包括: 所述终端在所述交易过程中出现所述智能卡离开所述终端的感应区域的 情况下, 重新搜寻到该智能卡后, 通过所述 PSAM读取并验证所述 MAC 2 信息的合法性, 如果所述 MAC 2信息合法, 则确定交易完成, 并生成新的交 易信息; 如果所述 MAC 2信息不合法, 则确定交易未发生, 若进一步判断出 智能卡内有组合钱包中除所述钱包外的钱包, 则针对所述组合钱包中除所述 钱包外的钱包进行重新交易。  Before the step of receiving the transaction response returned by the smart card, the method further includes: the terminal re-searching for the smart card after the smart card leaves the sensing area of the terminal in the transaction process Reading, by the PSAM, the validity of the MAC 2 information, if the MAC 2 information is legal, determining that the transaction is completed, and generating new transaction information; if the MAC 2 information is not legal, determining the transaction If the wallet other than the wallet in the combined wallet is further determined to be in the smart card, the wallet other than the wallet in the combined wallet is re-traded.
在所述接收该智能卡返回的交易响应的步骤之前, 所述方法还包括: 所述终端在所述交易过程中出现断电的异常并在上电后, 读取备份的所 述钱包的交易状态, 若判断出交易状态为交易完成, 则根据交易信息判断出 该钱包处于交易进行中, 则提示将该智能卡重新放入感应区域内, 若进一步 判断出该钱包当前的交易状态为交易完成, 则存储交易异常的记录, 同时终 止后续钱包的交易; 若进一步判断出智能卡存在组合钱包交易, 则存储所述 智能卡组合钱包中除所述钱包外的钱包已完成的交易信息, 对于未完成交易 的钱包则进行重新交易初始化的处理。  Before the step of receiving the transaction response returned by the smart card, the method further includes: the terminal experiencing a power failure abnormality during the transaction and reading the transaction status of the backed wallet after powering on If it is determined that the transaction status is the completion of the transaction, if it is determined that the wallet is in the process of conducting the transaction according to the transaction information, the smart card is prompted to be re-entered into the sensing area, and if it is further determined that the current transaction status of the wallet is the transaction completion, then Storing a record of the abnormality of the transaction, and terminating the transaction of the subsequent wallet; if it is further determined that the smart card has the combined wallet transaction, storing the transaction information of the wallet other than the wallet in the smart card combination wallet, for the wallet of the uncompleted transaction Then the process of re-transaction initialization is performed.
为了解决上述技术问题, 本发明提供了一种针对非接触式卡片的终端, 包括交易初始化模块、 数据库模块、 交易进行模块以及异常处理模块, 所述 卡片包括智能卡, 其中:  In order to solve the above technical problem, the present invention provides a terminal for a contactless card, including a transaction initialization module, a database module, a transaction execution module, and an exception processing module, wherein the card includes a smart card, wherein:
所述交易初始化模块设置为, 在进行交易的初始化处理时, 将所述智能 卡的钱包信息设置和 /或备份到数据库模块中, 其中至少将钱包的交易状态设 置为交易初始, 并向所述交易进行模块输出交易命令;  The transaction initialization module is configured to set and/or back up the wallet information of the smart card into a database module when the transaction is initialized, wherein at least the transaction status of the wallet is set to the transaction initial, and the transaction is Perform module output transaction commands;
所述数据库模块设置为, 存储设置和 /或备份的所述智能卡的钱包信息; 所述交易进行模块设置为, 根据所述交易初始化模块输出的所述交易命 令进行交易, 并在进行交易过程中逐步更新所述钱包的交易状态, 以及记录 钱包的交易信息; The database module is configured to store wallet information of the smart card set and/or backed up; the transaction performing module is configured to: according to the transaction life output by the transaction initialization module Ordering a transaction, and gradually updating the transaction status of the wallet during the transaction, and recording the transaction information of the wallet;
所述异常处理模块设置为, 在所述交易过程中出现所述终端或所述智能 卡异常, 则根据所述交易状态恢复正常的交易或终止异常的交易。  The exception handling module is configured to: when the terminal or the smart card is abnormal during the transaction, restore a normal transaction or terminate an abnormal transaction according to the transaction status.
所述交易初始化模块是设置为, 通过树形数据结构设置和 /或备份所述智 能卡内的钱包信息, 所述树形结构的根节点为钱包类型, 所述根节点的子节 点依次为一个或多个钱包类型, 每一个钱包类型包括一个或 n个钱包, 其中 n为大于 1 的整数; 所述智能卡内的钱包信息除所述钱包的交易状态外, 还 包括所述钱包类型、 钱包流水号、 智能卡所需的钱包个数、 总交易金额以及 智能卡标识信息中的一种或多种。  The transaction initialization module is configured to set and/or back up the wallet information in the smart card through a tree data structure, where the root node of the tree structure is a wallet type, and the child nodes of the root node are one or a plurality of wallet types, each wallet type includes one or n wallets, where n is an integer greater than 1; the wallet information in the smart card includes the wallet type and the wallet serial number in addition to the transaction status of the wallet One or more of the number of wallets required for the smart card, the total transaction amount, and the smart card identification information.
所述交易进行模块内含有消费安全存取模块 PSAM, 其中:  The transaction execution module includes a consumer security access module PSAM, wherein:
所述交易进行模块是设置为, 将交易状态设置为交易开始后, 向所述智 能卡发送交易请求, 并对该智能卡进行安全验证通过后, 将智能卡返回的交 易响应中的第二报文鉴别码 MAC2信息通过所述 PSAM进行交易合法性的验 证, 根据所述 PSAM的交易合法的验证结果, 更改所述数据库模块中存储的 钱包的交易状态为交易完成, 并生成新的交易信息。  The transaction execution module is configured to set a transaction status to a second message authentication code in a transaction response returned by the smart card after the transaction status is started, the transaction request is sent to the smart card, and the smart card is subjected to security verification. The MAC2 information is verified by the PSAM for transaction legality, and according to the legal verification result of the transaction of the PSAM, the transaction status of the wallet stored in the database module is changed to completion of the transaction, and new transaction information is generated.
异常处理模块包括第一异常处理单元, 其中:  The exception handling module includes a first exception handling unit, where:
所述第一异常处理单元设置为, 处理所述智能卡离开终端感应区域的异 常, 指示所述交易进行模块进行非断电异常处理;  The first exception processing unit is configured to process an abnormality of the smart card leaving the terminal sensing area, and instruct the transaction performing module to perform a non-power-off abnormality processing;
所述交易进行模块还设置为, 根据所述第一异常处理单元的非断电异常 处理的指示, 当重新搜寻到该智能卡后, 通过所述 PSAM读取并验证所述 MAC2信息的合法性, 如果所述 MAC 2信息合法, 则确定交易完成, 并生成 新的交易信息; 如果所述 MAC 2信息不合法, 则认为交易未发生, 若进一步 判断出智能卡内有组合钱包中除所述钱包外的其它钱包, 则针对所述组合钱 包中除所述钱包外的钱包进行重新交易。  The transaction execution module is further configured to: according to the indication of the non-power-off exception processing of the first exception processing unit, after re-searching for the smart card, read and verify the validity of the MAC2 information by using the PSAM, If the MAC 2 information is legal, it is determined that the transaction is completed, and new transaction information is generated; if the MAC 2 information is not legal, the transaction is considered not to occur, and if it is further determined that there is a combined wallet in the smart card other than the wallet The other wallet is re-traded for the wallet other than the wallet in the combined wallet.
异常处理模块还包括第二异常处理单元, 其中:  The exception handling module further includes a second exception handling unit, wherein:
所述第二异常处理单元设置为, 在所述交易进行模块发生断电异常并在 上电后, 读取所述数据库模块中备份的所述钱包的交易状态, 若判断出交易 状态为交易完成, 则根据交易信息判断当前的钱包是否处于交易进行中, 如 果当前的钱包处于交易中,则指示所述交易进行模块进行第一断电异常处理; 若判断出智能卡存在组合钱包交易, 则指示所述交易进行模块进行第二断电 异常处理; The second exception processing unit is configured to: when the transaction execution module generates a power failure abnormality and after powering on, read the transaction status of the wallet backed up in the database module, if the transaction is determined If the status is transaction completion, it is determined whether the current wallet is in the transaction according to the transaction information. If the current wallet is in the transaction, the transaction execution module is instructed to perform the first power failure abnormality processing; if it is determined that the smart card has the combined wallet transaction And instructing the transaction performing module to perform a second power failure abnormality processing;
所述交易进行模块还设置为, 根据所述第一断电异常处理的指示, 将智 能卡重新放入感应区域内, 并判断该钱包当前的交易状态是否为交易完成, 如果该钱包当前的交易状态为交易完成, 则存储交易异常的记录, 同时终止 后续钱包的交易; 和 /或根据所述第二断电异常处理的指示, 存储智能卡组合 钱包中除所述钱包外的钱包已完成的交易信息, 对于未完成交易的钱包则进 行重新交易初始化的处理。  The transaction proceeding module is further configured to: re-input the smart card into the sensing area according to the instruction of the first power-off abnormality processing, and determine whether the current transaction status of the wallet is a transaction completion, if the current transaction status of the wallet If the transaction is completed, storing a record of the transaction abnormality, and terminating the transaction of the subsequent wallet; and/or storing the transaction information of the smart card combination wallet in the smart card combination wallet except the wallet according to the indication of the second power failure abnormality processing For the wallet that has not completed the transaction, the re-transaction initialization process is performed.
本发明的针对非接触式卡片的终端及其处理异常的方法, 通过消费终端 对智能卡初始化时进行必要的数据备份, 包括交易状态、 钱包类型、 需要的 钱包个数、 当前钱包流水号、 每次交易的总金额、 智能卡标识(譬如智能卡 序列号)等信息, 并在交易过程中逐步地修改交易状态及其相应的数据; 由 此, 使得终端能够在出现终端或智能卡异常之后可以从交易状态所示的步骤 开始处理, 并恢复相应的数据, 从而使得交易能够在异常去除后继续进行下 去。  The terminal for the contactless card and the method for processing the abnormality of the invention, perform necessary data backup when the smart card is initialized by the consumer terminal, including the transaction status, the wallet type, the required number of wallets, the current wallet serial number, each time The total amount of the transaction, the smart card identification (such as the smart card serial number) and other information, and gradually modify the transaction status and its corresponding data during the transaction process; thus, the terminal can be from the transaction status after the terminal or smart card abnormality occurs The illustrated steps begin processing and restore the corresponding data so that the transaction can continue after the exception is removed.
附图概述 BRIEF abstract
图 1是现有的智能卡应用于消费的脱机交易的系统结构示意图; 图 2是本发明用于一卡多钱包的智能卡信息存储的数据结构实施例示意 图;  1 is a schematic diagram of a system structure of an existing smart card applied to an offline transaction of consumption; FIG. 2 is a schematic diagram of a data structure of a smart card information storage for a card multi-wallet according to the present invention;
图 3是本发明的交易方法的实施例流程图;  3 is a flow chart of an embodiment of a transaction method of the present invention;
图 4 是本发明的没断电的防拔处理方法实施例流程;  4 is a flow chart of an embodiment of the method for preventing and removing the power failure of the present invention;
图 5是本发明的断电重新上电后的防拔处理方法实施例流程;  5 is a flow chart of an embodiment of an anti-drawing treatment method after power-off and re-powering according to the present invention;
图 6是本发明针对非接触式智能卡的终端实施例的结构示意图。  FIG. 6 is a schematic structural diagram of a terminal embodiment of a contactless smart card according to the present invention.
本发明的较佳实施方式 Preferred embodiment of the invention
下面结合附图和优选实施例对本发明的技术方案进行详细地阐述。 以下 列举的实施例仅仅用于说明和解释本发明, 而不构成对本发明技术方案的限 制。 The technical solution of the present invention will be described in detail below with reference to the accompanying drawings and preferred embodiments. the following The exemplified embodiments are only intended to illustrate and explain the present invention, and do not constitute a limitation of the technical solutions of the present invention.
如图 2所示, 是本发明提供的用于一卡多钱包的智能卡中钱包信息存储 的数据结构的一实施例, 它是一个树形结构。 其中, 在钱包类型节点下可以 有一个或多个具体的钱包类型, 譬如以消费金额为特点的钱包类型 1、 以消 费次数为特点的钱包类型 2; 在钱包类型 1的节点下又可以包括 1个或多个 钱包, 譬如以企业消费为主体的 1号钱包、 以企业消费补助的 2号钱包, 等 等。 当然, 除了釆用树状结构外, 本发明对钱包信息存储的数据结构还可以 釆用图状结构或网状结构等。  As shown in FIG. 2, it is an embodiment of the data structure of the wallet information storage in the smart card for a card multi-wallet provided by the present invention, which is a tree structure. There may be one or more specific wallet types under the wallet type node, such as a wallet type characterized by a consumption amount, a wallet type 2 characterized by a consumption number, and a wall type 1 node. One or more wallets, such as the No. 1 wallet with corporate consumption as the main body, the No. 2 wallet with corporate consumption subsidies, and so on. Of course, in addition to the tree structure, the data structure of the wallet information storage of the present invention can also use a map structure or a mesh structure.
如图 3所示, 为本发明提供的应用于一"" ^多钱包的智能卡进行交易的方 法的实施例流程, 包括如下步骤:  As shown in FIG. 3, the flow of an embodiment of a method for processing a smart card applied to a "multi-wallet" according to the present invention includes the following steps:
201、 202: 终端机针对智能卡上一个钱包向智能卡发送交易的初始化请 求, 并等待智能卡返回的初始化响应;  201, 202: The terminal sends an initialization request for the transaction to the smart card for a wallet on the smart card, and waits for an initialization response returned by the smart card;
203、 204: 如果智能卡返回的初始化响应结果为该钱包余额不足或是余 额过期, 且该卡可处于多钱包消费的情况 (即图 2所示的树形结构中一个钱 包类型节点下有多个分支) , 则该卡的其它钱包也向智能卡发送交易的初始 化请求, 并根据对智能卡返回的初始化响应结果进行验证, 确定该智能卡是 否可以进行多钱包组合消费。 本发明为了使终端在智能卡或终端出现异常后及时进行防拔处理, 提出 进行数据备份, 它是保证数据的一致性必不可少的环节。 而备份哪些数据, 在何时备份, 则直接影响着终端的处理时间。  203, 204: If the initialization response returned by the smart card is that the wallet balance is insufficient or the balance is out of date, and the card can be in the multi-wallet consumption situation (ie, there are multiple wallet type nodes in the tree structure shown in FIG. 2) Branch), the other wallet of the card also sends an initialization request for the transaction to the smart card, and according to the initialization response result returned by the smart card, it is determined whether the smart card can perform multi-wallet combination consumption. In order to make the terminal perform the anti-drawing process in time after the abnormality occurs in the smart card or the terminal, the present invention proposes to perform data backup, which is an essential part for ensuring the consistency of the data. The backup data, when it is backed up, directly affects the processing time of the terminal.
本发明在对智能卡内的钱包的管理上, 釆用如图 2所示的树形结构, 该 结构在可以节省存储数据的空间的前提下提高终端处理的时间。 需要在该树 形数据结构中备份的数据如下表 1所示。  In the management of the wallet in the smart card, the present invention uses a tree structure as shown in Fig. 2, which improves the processing time of the terminal on the premise that the space for storing data can be saved. The data that needs to be backed up in this tree data structure is shown in Table 1 below.
智能卡的备份数据
Figure imgf000009_0001
首先终端在进行消费初始化的时侯, 可设置智能卡内钱包的交易状态、 钱包类型、 需要的钱包个数、 每次交易总金额、 智能卡标识(譬如通过智能 卡的应用序列号实现)等信息, 其中, 将交易状态设置为交易初始。 终端在 交易过程中可逐步修改交易状态, 以便终端在出现异常之后从交易状态所示 的步骤开始进行处理, 并根据备份数据恢复钱包流水号、 钱包个数以及交易 总金额等信息。
Smart card backup data
Figure imgf000009_0001
First, when the terminal initializes the consumption, the terminal can set the transaction status of the wallet in the smart card, the type of the wallet, the number of wallets required, the total amount of each transaction, and the smart card identification (for example, by using the application serial number of the smart card), wherein , set the transaction status to the initial transaction. The terminal can gradually modify the transaction status during the transaction process, so that the terminal starts processing from the step indicated by the transaction status after the abnormality occurs, and recovers the information such as the wallet serial number, the number of wallets, and the total transaction amount according to the backup data.
205、206:消费过程开始,首先终端机向 PSAM发送初始化请求,由 PSAM 在返回的初始化响应中携带交易所需要的验证信息第一报文鉴别码 ( MAC1 ) ;  205, 206: The consumption process starts, first, the terminal sends an initialization request to the PSAM, and the PSAM carries the first message authentication code (MAC1) of the verification information required by the transaction in the returned initialization response;
207-209: 终端机向智能卡发送交易请求, 并对智能卡安全验证通过后, 智能卡返回交易响应;  207-209: The terminal sends a transaction request to the smart card, and after the smart card is successfully verified, the smart card returns a transaction response;
终端机在前面的步骤中已对智能卡的钱包类型、 钱包流水号, 需要的钱 包个数、 总交易金额以及智能卡标识等信息进行了初始化设置; 在向智能卡 发送交易请求之前, 需先将交易状态设置为交易开始, 然后发送交易请求。  In the previous steps, the terminal has initialized the information such as the wallet type of the smart card, the wallet serial number, the number of wallets required, the total transaction amount, and the smart card identification; before sending the transaction request to the smart card, the transaction status needs to be first Set to start trading and then send a trade request.
210、 211 : 终端机将智能卡交易响应结果中的 MAC2传输给 PSAM, 随 后接收 PSAM的交易合法性的验证结果, 终端机则将交易状态更新为交易完 成。  210, 211: The terminal transmits the MAC2 in the smart card transaction response result to the PSAM, and then receives the verification result of the transaction validity of the PSAM, and the terminal updates the transaction status to the transaction completion.
交易可以首先从所确定的钱包类型分支下序列号最小的那个钱包开始, 或者相反, 或者从任意一个序列号的钱包开始。  The transaction may begin with the wallet with the smallest serial number under the determined wallet type branch, or conversely, or start with any one of the serial number wallets.
如果在上述步骤 209智能卡返回交易响应之前发生异常, 本发明按照智 能卡离开终端机的感应区或者终端机发生断电这两类异常, 分别进行如下防 拔处理:  If an abnormality occurs before the smart card returns the transaction response in the above step 209, the present invention performs the following anti-drawal processing according to the abnormality that the smart card leaves the sensing area of the terminal or the terminal is powered off:
( 1 )终端未发生断电, 其防拔处理的方法实施例流程如图 4所示, 包括 如下步骤: 步骤 301 : 终端机一直搜寻智能卡, 直到寻到原卡为止, 或者操作员强 行停止交易;  (1) The terminal does not have a power failure, and the flow of the method for preventing the removal process is as shown in FIG. 4, and includes the following steps: Step 301: The terminal always searches for the smart card until the original card is found, or the operator forcibly stops the transaction. ;
步骤 302、 303: 读取原智能卡 MAC2信息, 并验证 MAC2信息的合法 性, 如果合法, 则执行步骤 304, 否则执行步骤 305; 步骤 304: 交易完成, 生成新的交易记录, 结束流程; Steps 302, 303: Read the original smart card MAC2 information, and verify the validity of the MAC2 information, if it is legal, go to step 304, otherwise go to step 305; Step 304: The transaction is completed, a new transaction record is generated, and the process ends;
步骤 305~307: 交易未发生, 此时进一步判断智能卡内是否为组合钱包 中的 2号钱包, 是则针对该钱包进行重新交易, 否则结束流程。  Steps 305~307: The transaction does not occur. At this time, it is further determined whether the smart card is the No. 2 wallet in the combined wallet, and then the transaction is re-traded for the wallet, otherwise the process ends.
( 2 )终端发生断电, 其防拔处理的方法实施例流程如图 5所示, 包括如 下步骤:  (2) The terminal is powered off, and the flow of the method for preventing the pull-out process is as shown in FIG. 5, and includes the following steps:
步骤 401 : 终端机断电后重新上电, 首先读取备份文件;  Step 401: After the terminal is powered off, the power is turned on again, and the backup file is first read;
从备份文件中获取备份信息, 其内容如表 1所示。  The backup information is obtained from the backup file, and its contents are shown in Table 1.
步骤 402: 根据读取的备份文件中的交易状态, 判断交易是否完成, 是 则执行步骤 403 , 否则结束流程;  Step 402: Determine whether the transaction is completed according to the transaction status in the read backup file, if yes, execute step 403; otherwise, end the process;
步骤 403: 根据交易已完成, 判断需进行断电防拔处理;  Step 403: According to the completion of the transaction, it is judged that the power-off prevention process is required;
步骤 404~406: 根据交易记录判断出一号钱包是否处于交易进行中; 如 果该钱包是处于交易进行中, 则提示将智能卡重新放入感应区域内, 进一步 判断智能卡中该钱包当前的交易是否完成, 是则存储交易异常的记录, 同时 终止后续钱包的交易, 否则结束流程。  Steps 404~406: According to the transaction record, it is determined whether the first wallet is in the middle of the transaction; if the wallet is in the middle of the transaction, the smart card is prompted to be put back into the sensing area to further determine whether the current transaction of the wallet in the smart card is completed. , is to store a record of transaction anomalies, and terminate the subsequent wallet transactions, otherwise the process ends.
终端机判断智能卡中该钱包当前的交易是否完成, 是根据当前的钱包类 型确定当前使用的钱包, 并通过流水号读取智能卡中该记录的验证信息 MAC2。 如果验证信息读取成功, 则说明智能卡已扣费, 而该卡中的记录与 终端机的交易记录不一致, 此时由于终端机的断电未保留原 PSAM中的初始 化信息, 故无法对该笔交易进行验证, 因而无法生成新的交易流水号, 则终 端机提示交易异常。 如果该钱包未处于交易进行中 (即没有交易记录) , 提 示交易未发生, 并结束流程。  The terminal determines whether the current transaction of the wallet in the smart card is completed, determines the currently used wallet according to the current wallet type, and reads the verification information MAC2 of the record in the smart card by using the serial number. If the verification information is successfully read, the smart card has been deducted, and the record in the card is inconsistent with the transaction record of the terminal. At this time, since the terminal device is powered off, the initialization information in the original PSAM is not retained, so the pen cannot be used. The transaction is verified, so that a new transaction serial number cannot be generated, and the terminal prompts that the transaction is abnormal. If the wallet is not in the process of trading (ie no transaction history), the prompt transaction does not occur and the process ends.
步骤 407 410: 如果存在组合钱包交易,则存储智能卡其它钱包(n-1个, n为大于 1 的整数) 已完成的交易记录, 对于未完成交易其它钱包则进行重 新交易初始化的处理, 具体地:  Step 407 410: If there is a combined wallet transaction, store the completed transaction record of the smart card other wallet (n-1, n is an integer greater than 1), and perform retransaction initialization processing for the other wallet without completing the transaction, specifically :
步骤 407: 在判断存在组合钱包交易的情况下, 如果继续判断下一个钱 包(譬如二号钱包)处于交易进行中;  Step 407: If it is determined that there is a combined wallet transaction, if it continues to judge that the next wallet (such as the second wallet) is in the transaction;
步骤 408: 继续判断该交易是否完成, 是则执行步骤 409, 否则执行步骤 Step 408: Continue to judge whether the transaction is completed, if yes, go to step 409, otherwise, perform step
410; 步骤 409: 存储异常交易记录, 结束流程; 410; Step 409: Store an abnormal transaction record, and end the process;
步骤 410: 对该钱包进行重新交易初始化操作, 结束流程。  Step 410: Perform a re-transaction initialization operation on the wallet, and end the process.
其它三号钱包 (n-1)个钱包的处理可重复步骤 407 410。  The processing of the other three wallets (n-1) wallets may repeat step 407 410.
本发明针对上述方法实施例, 相应地还提出一种非接触式智能卡的终端 实施例, 其结构如图 6所示, 该终端 500包括交易初始化模块 510、 数据库 模块 520、 含有 PSAM的交易进行模块 530以及异常处理模块 540, 其中: 交易初始化模块 510设置为, 在进行消费的初始化处理时, 将智能卡的 钱包信息设置和 /或备份到数据库模块 520中, 其中至少将钱包的交易状态设 置为交易初始, 向交易进行模块 530输出交易命令;  The present invention is directed to the foregoing method embodiments, and correspondingly, a terminal embodiment of a contactless smart card is provided. The structure of the terminal is as shown in FIG. 6. The terminal 500 includes a transaction initialization module 510, a database module 520, and a transaction execution module including a PSAM. 530 and an exception processing module 540, wherein: the transaction initialization module 510 is configured to set and/or back up the wallet information of the smart card into the database module 520 during the initialization process of the consumption, wherein at least the transaction status of the wallet is set as a transaction. Initially, the transaction execution module 530 outputs a transaction command;
交易初始化模块 510可根据智能卡的钱包信息的一树形数据结构 (或其 它数据结构)确定该智能卡的钱包交易状态、 钱包类型、 钱包流水号、 智能 卡所需的钱包个数、 总交易金额以及智能卡标识等信息, 如表 1所示。  The transaction initialization module 510 can determine the wallet transaction status, the wallet type, the wallet serial number, the number of wallets required for the smart card, the total transaction amount, and the smart card according to a tree data structure (or other data structure) of the smart card's wallet information. Information such as identification, as shown in Table 1.
数据库模块 520设置为, 存储智能卡的上述备份信息;  The database module 520 is configured to store the foregoing backup information of the smart card;
交易进行模块 530设置为, 根据交易初始化模块 510输出的交易命令进 行交易, 并在进行交易过程中逐步更新所述钱包的交易状态, 以及进行钱包 的交易记录;  The transaction progress module 530 is configured to perform a transaction according to the transaction command output by the transaction initialization module 510, and gradually update the transaction status of the wallet and perform a transaction record of the wallet during the transaction;
交易进行模块 530将交易状态设置为交易开始后, 向智能卡发送交易请 求, 并对智能卡进行安全验证通过后, 将智能卡返回的交易响应中的 MAC2 通过 PSAM进行交易合法性的验证,根据 PSAM返回的交易合法的验证结果, 更改数据库模块 520中的存储的钱包的消费状态为消费完成, 并生成新的交 易记录。  The transaction progress module 530 sets the transaction status to send a transaction request to the smart card after the transaction starts, and after performing the security verification on the smart card, the MAC2 in the transaction response returned by the smart card is verified by the PSAM, and the return is based on the PSAM. The legal verification result is processed, the consumption status of the stored wallet in the database module 520 is changed to consumption completion, and a new transaction record is generated.
异常处理模块 540设置为, 在监测交易进行模块 530进行交易过程中出 现智能卡或终端断电异常时, 根据从数据库模块 520读取的智能卡当前钱包 的交易状态进行相应的防拔处理。  The exception handling module 540 is configured to perform a corresponding pull-out process according to the transaction status of the current wallet of the smart card read from the database module 520 when the smart card or terminal power-off abnormality occurs during the transaction process of the monitoring transaction performing module 530.
异常处理模块 540包括第一异常处理单元 5401和 /或第二异常处理单元 The exception handling module 540 includes a first exception handling unit 5401 and/or a second exception handling unit.
5402, 其中: 5402, where:
第一异常处理单元 5401设置为, 处理智能卡离开终端感应区的异常, 即 指示交易进行模块 530进行非断电异常处理; 第二异常处理单元 5402设置为,处理交易进行模块 530在发生断电异常 的防拔处理, 即上电后读取数据库模块 520中智能卡备份数据的交易状态, 若判断交易已完成, 则根据交易记录判断当前的钱包是否处于交易进行中, 是则指示交易进行模块 530进行第一断电异常处理; 若判断智能卡存在组合 钱包交易, 则指示交易进行模块 530进行第二断电异常处理; The first exception processing unit 5401 is configured to process the abnormality of the smart card leaving the terminal sensing area, that is, instruct the transaction performing module 530 to perform the non-power-off abnormal processing; The second exception processing unit 5402 is configured to process the transaction execution module 530 to perform the pull-out processing of the power-off abnormality, that is, read the transaction status of the smart card backup data in the database module 520 after power-on, and if it is determined that the transaction has been completed, according to the transaction The record is used to determine whether the current wallet is in the process of conducting, and the transaction execution module 530 is instructed to perform the first power failure abnormality processing; if it is determined that the smart card has the combined wallet transaction, the transaction execution module 530 is instructed to perform the second power failure abnormality processing;
交易进行模块 530还设置为,根据第一异常处理单元 5401的非断电异常 处理的指示,当重新搜寻到原智能卡后,通过 PSAM读取并验证其中的 MAC2 信息的合法性, 合法则认为交易完成, 生成新的交易记录; 不合法则认为交 易未发生, 若进一步判断智能卡内有组合钱包中的其它钱包, 则针对该钱包 进行重新交易。  The transaction progress module 530 is further configured to: according to the indication of the non-power-off exception processing of the first exception processing unit 5401, after re-searching for the original smart card, the validity of the MAC2 information is read and verified by the PSAM, and the transaction is considered as a transaction. Complete, generate a new transaction record; if it is illegal, the transaction is not considered. If it is further determined that there are other wallets in the combined wallet in the smart card, the wallet is re-traded.
交易进行模块 530还设置为,根据第二异常处理单元 5402的第一断电异 常处理的指示, 提示将智能卡重新放入感应区域内, 继续判断该钱包当前交 易是否完成, 是则存储交易异常的记录, 同时终止后续钱包的交易; 根据第 二异常处理单元 5402的第二断电异常处理的指示,存储智能卡其它钱包已完 成的交易记录, 对于未完成交易其它钱包则进行重新交易初始化的处理。  The transaction progress module 530 is further configured to prompt to re-set the smart card into the sensing area according to the instruction of the first power-off abnormality processing of the second abnormality processing unit 5402, and continue to determine whether the current transaction of the wallet is completed, and the storage transaction is abnormal. Recording, simultaneously terminating the transaction of the subsequent wallet; storing the transaction record of the other wallet of the smart card according to the instruction of the second power failure abnormality processing of the second abnormality processing unit 5402, and performing the process of re-transaction initialization for the other wallet without completing the transaction.
本发明通过消费终端对智能卡初始化时进行必要的数据备份, 包括交易 状态、 钱包类型、 需要的钱包个数、 当前钱包流水号、 每次交易的总金额、 智能卡标识 (譬如智能卡序列号)等信息, 并在交易过程中逐步地修改交易 状态及其相应的数据; 由此使得终端能够在出现异常之后可以从交易状态所 示的步骤开始处理, 并恢复相应的数据, 从而使得交易能够在异常去除后继 续进行下去。  The invention performs necessary data backup when the smart card is initialized by the consumer terminal, including transaction status, wallet type, number of wallets required, current wallet serial number, total amount of each transaction, smart card identification (such as smart card serial number) and the like. And gradually modify the transaction status and its corresponding data during the transaction; thereby enabling the terminal to start processing from the step indicated by the transaction status after the occurrence of the abnormality, and recover the corresponding data, thereby enabling the transaction to be abnormally removed Continue on.
本领域普通技术人员可以理解上述方法中的全部或部分步骤可通过程序 来指令相关硬件完成, 所述程序可以存储于计算机可读存储介质中, 如只读 存储器、 磁盘或光盘等。 可选地, 上述实施例的全部或部分步骤也可以使用 一个或多个集成电路来实现。相应地, 上述实施例中的各模块 /单元可以釆用 硬件的形式实现, 也可以釆用软件功能模块的形式实现。 本发明不限制于任 何特定形式的硬件和软件的结合。  One of ordinary skill in the art will appreciate that all or a portion of the steps above may be accomplished by a program to instruct the associated hardware, such as a read-only memory, a magnetic disk, or an optical disk. Alternatively, all or part of the steps of the above embodiments may also be implemented using one or more integrated circuits. Correspondingly, each module/unit in the above embodiment may be implemented in the form of hardware or in the form of a software function module. The invention is not limited to any specific form of combination of hardware and software.
本说明书所附实施例是体现本发明构思的一些典型例子, 并不排除使用 体现本发明设计方案的其他实施例。在不背离本发明精神及其实质的情况下, 相应的改变和变形都应属于本发明所附的权利要求的保护范围。 The embodiments attached to the present specification are some typical examples embodying the inventive concept, and other embodiments embodying the design of the present invention are not excluded. Without departing from the spirit and spirit of the invention, Corresponding changes and modifications are intended to be included within the scope of the appended claims.
工业实用性 Industrial applicability
本发明提供的针对非接触式卡片的终端及其处理异常的方法, 通过消费 终端对智能卡初始化时进行必要的数据备份, 并在交易过程中逐步地修改交 易状态及其相应的数据; 由此, 使得终端能够在出现终端或智能卡异常之后 可以从交易状态所示的步骤开始处理, 并恢复相应的数据, 从而使得交易能 够在异常去除后继续进行下去。  The terminal for the contactless card and the method for processing the abnormality provided by the invention, perform necessary data backup when the smart card is initialized by the consumer terminal, and gradually modify the transaction state and its corresponding data in the transaction process; The terminal can enable the terminal to start processing from the step indicated by the transaction state after the terminal or smart card abnormality occurs, and restore the corresponding data, so that the transaction can continue after the abnormal removal.

Claims

权 利 要 求 书 Claim
1、 一种针对非接触式卡片的终端处理异常的方法, 其中, 所述卡片包括 智能卡, 所述方法包括:  A method for processing an abnormality of a terminal of a contactless card, wherein the card comprises a smart card, and the method comprises:
所述终端在进行交易的初始化处理时, 设置和 /或备份所述智能卡的钱包 信息, 并至少将钱包的交易状态设置为交易初始; 以及  The terminal sets and/or backs up the wallet information of the smart card when the transaction is initialized, and sets at least the transaction status of the wallet as the transaction initial;
所述终端在进行交易过程中逐步更新所述钱包的交易状态, 并记录所述 钱包的交易信息; 若在所述交易过程中出现所述终端或所述智能卡异常, 则 根据所述交易状态恢复正常的交易或终止异常的交易。  The terminal gradually updates the transaction status of the wallet during the transaction process, and records the transaction information of the wallet; if the terminal or the smart card is abnormal during the transaction, the terminal is restored according to the transaction status A normal transaction or termination of an abnormal transaction.
2、 按照权利要求 1 所述的方法, 其中, 在所述设置和 /或备份所述智能 卡的钱包信息的步骤中,  2. The method according to claim 1, wherein in the step of setting and/or backing up the wallet information of the smart card,
通过树形数据结构设置和 /或备份所述智能卡内的钱包信息, 所述树形结 构的根节点为钱包类型, 所述根节点的子节点依次为一个或多个钱包类型, 每一个钱包类型包括一个或 n个钱包, 其中 n为大于 1的整数; 所述智能卡 内的钱包信息除所述钱包的交易状态外, 还包括所述钱包类型、钱包流水号、 智能卡所需的钱包个数、 总交易金额以及智能卡标识信息中的一种或多种。  Setting and/or backing up wallet information in the smart card by a tree data structure, the root node of the tree structure is a wallet type, and the child nodes of the root node are one or more wallet types in turn, and each wallet type Included in the wallet information, the wallet information in the One or more of the total transaction amount and smart card identification information.
3、 按照权利要求 1或 2所述的方法, 其中, 所述终端在进行交易过程中 逐步更新所述钱包的交易状态的步骤包括:  3. The method according to claim 1 or 2, wherein the step of the terminal gradually updating the transaction status of the wallet during the transaction process comprises:
在将所述交易状态设置为交易开始后, 向所述智能卡发送交易请求, 并 在对该智能卡安全验证通过后, 接收该智能卡返回的交易响应; 以及  After setting the transaction status as a transaction start, sending a transaction request to the smart card, and after receiving the security verification of the smart card, receiving a transaction response returned by the smart card;
所述终端将所述交易响应中的第二报文鉴别码 MAC2信息传输给消费安 全存取模块 PSAM, 根据所述 PSAM返回的交易合法性的验证结果, 将钱包 的交易状态更新为交易完成。  The terminal transmits the second message authentication code MAC2 information in the transaction response to the consumption security access module PSAM, and updates the transaction status of the wallet to completion of the transaction according to the verification result of the transaction legality returned by the PSAM.
4、 按照权利要求 3所述的方法, 其中, 在所述接收该智能卡返回的交易 响应的步骤之前, 所述方法还包括:  4. The method of claim 3, wherein before the step of receiving the transaction response returned by the smart card, the method further comprises:
所述终端在所述交易过程中出现所述智能卡离开所述终端的感应区域的 情况下, 重新搜寻到该智能卡后, 通过所述 PSAM读取并验证所述 MAC 2 信息的合法性, 如果所述 MAC 2信息合法, 则确定交易完成, 并生成新的交 易信息; 如果所述 MAC 2信息不合法, 则确定交易未发生, 若进一步判断出 智能卡内有组合钱包中除所述钱包外的钱包, 则针对所述组合钱包中除所述 钱包外的钱包进行重新交易。 If the smart card leaves the sensing area of the terminal during the transaction, the terminal searches for and verifies the validity of the MAC 2 information through the PSAM after re-searching for the smart card. If the MAC 2 information is legal, it is determined that the transaction is completed, and new transaction information is generated; if the MAC 2 information is not legal, it is determined that the transaction has not occurred, and if further determined The smart card has a wallet other than the wallet in the combined wallet, and re-transacts the wallet except the wallet in the combined wallet.
5、 按照权利要求 3所述的方法, 其中, 在所述接收该智能卡返回的交易 响应的步骤之前, 所述方法还包括:  5. The method of claim 3, wherein before the step of receiving the transaction response returned by the smart card, the method further comprises:
所述终端在所述交易过程中出现断电的异常并在上电后, 读取备份的所 述钱包的交易状态, 若判断出交易状态为交易完成, 则根据交易信息判断出 该钱包处于交易进行中, 则提示将该智能卡重新放入感应区域内, 若进一步 判断出该钱包当前的交易状态为交易完成, 则存储交易异常的记录, 同时终 止后续钱包的交易; 若进一步判断出智能卡存在组合钱包交易, 则存储所述 智能卡组合钱包中除所述钱包外的钱包已完成的交易信息, 对于未完成交易 的钱包则进行重新交易初始化的处理。  The terminal has an abnormality of power failure during the transaction and reads the transaction status of the backed wallet after power-on, and if it is determined that the transaction status is completed, the wallet is determined to be in a transaction according to the transaction information. In progress, the smart card is prompted to be put back into the sensing area. If it is further determined that the current transaction status of the wallet is the transaction completion, the transaction abnormal record is stored, and the subsequent wallet transaction is terminated; if it is further determined that the smart card has a combination The wallet transaction stores the transaction information of the smart card combination wallet in which the wallet other than the wallet has been completed, and the re-transaction initialization process for the wallet that has not completed the transaction.
6、 一种针对非接触式卡片的终端, 包括交易初始化模块、 数据库模块、 交易进行模块以及异常处理模块, 所述卡片包括智能卡, 其中:  6. A terminal for a contactless card, comprising a transaction initialization module, a database module, a transaction execution module, and an exception processing module, wherein the card comprises a smart card, wherein:
所述交易初始化模块设置为, 在进行交易的初始化处理时, 将所述智能 卡的钱包信息设置和 /或备份到数据库模块中, 其中至少将钱包的交易状态设 置为交易初始, 并向所述交易进行模块输出交易命令;  The transaction initialization module is configured to set and/or back up the wallet information of the smart card into a database module when the transaction is initialized, wherein at least the transaction status of the wallet is set to the transaction initial, and the transaction is Perform module output transaction commands;
所述数据库模块设置为, 存储设置和 /或备份的所述智能卡的钱包信息; 所述交易进行模块设置为, 根据所述交易初始化模块输出的所述交易命 令进行交易, 并在进行交易过程中逐步更新所述钱包的交易状态, 以及记录 钱包的交易信息;  The database module is configured to store wallet information of the smart card set and/or backed up; the transaction performing module is configured to perform a transaction according to the transaction command output by the transaction initialization module, and during the transaction process Gradually updating the transaction status of the wallet, and recording the transaction information of the wallet;
所述异常处理模块设置为, 在所述交易过程中出现所述终端或所述智能 卡异常, 则根据所述交易状态恢复正常的交易或终止异常的交易。  The exception handling module is configured to: when the terminal or the smart card is abnormal during the transaction, restore a normal transaction or terminate an abnormal transaction according to the transaction status.
7、 按照权利要求 6所述的终端, 其中,  7. The terminal according to claim 6, wherein
所述交易初始化模块是设置为, 通过树形数据结构设置和 /或备份所述智 能卡内的钱包信息, 所述树形结构的根节点为钱包类型, 所述根节点的子节 点依次为一个或多个钱包类型, 每一个钱包类型包括一个或 n个钱包, 其中 n为大于 1 的整数; 所述智能卡内的钱包信息除所述钱包的交易状态外, 还 包括所述钱包类型、 钱包流水号、 智能卡所需的钱包个数、 总交易金额以及 智能卡标识信息中的一种或多种。 The transaction initialization module is configured to set and/or back up the wallet information in the smart card through a tree data structure, where the root node of the tree structure is a wallet type, and the child nodes of the root node are one or a plurality of wallet types, each wallet type includes one or n wallets, where n is an integer greater than 1; the wallet information in the smart card includes the wallet type and the wallet serial number in addition to the transaction status of the wallet , the number of wallets required for the smart card, the total transaction amount, and One or more of the smart card identification information.
8、 按照权利要求 6或 7所述的终端, 其中, 所述交易进行模块内含有消 费安全存取模块 PSAM, 其中:  8. The terminal according to claim 6 or 7, wherein the transaction execution module includes a consumer security access module PSAM, wherein:
所述交易进行模块是设置为, 将交易状态设置为交易开始后, 向所述智 能卡发送交易请求, 并对该智能卡进行安全验证通过后, 将智能卡返回的交 易响应中的第二报文鉴别码 MAC2信息通过所述 PSAM进行交易合法性的验 证, 根据所述 PSAM的交易合法的验证结果, 更改所述数据库模块中存储的 钱包的交易状态为交易完成, 并生成新的交易信息。  The transaction execution module is configured to set a transaction status to a second message authentication code in a transaction response returned by the smart card after the transaction status is started, the transaction request is sent to the smart card, and the smart card is subjected to security verification. The MAC2 information is verified by the PSAM for transaction legality, and according to the legal verification result of the transaction of the PSAM, the transaction status of the wallet stored in the database module is changed to completion of the transaction, and new transaction information is generated.
9、 按照权利要求 8所述的终端, 其中, 所述异常处理模块包括第一异常 处理单元, 其中:  9. The terminal according to claim 8, wherein the exception processing module comprises a first exception processing unit, wherein:
所述第一异常处理单元设置为, 处理所述智能卡离开终端感应区域的异 常, 指示所述交易进行模块进行非断电异常处理;  The first exception processing unit is configured to process an abnormality of the smart card leaving the terminal sensing area, and instruct the transaction performing module to perform a non-power-off abnormality processing;
所述交易进行模块还设置为, 根据所述第一异常处理单元的非断电异常 处理的指示, 当重新搜寻到该智能卡后, 通过所述 PSAM读取并验证所述 MAC2信息的合法性, 如果所述 MAC 2信息合法, 则确定交易完成, 并生成 新的交易信息; 如果所述 MAC 2信息不合法, 则认为交易未发生, 若进一步 判断出智能卡内有组合钱包中除所述钱包外的其它钱包, 则针对所述组合钱 包中除所述钱包外的钱包进行重新交易。  The transaction execution module is further configured to: according to the indication of the non-power-off exception processing of the first exception processing unit, after re-searching for the smart card, read and verify the validity of the MAC2 information by using the PSAM, If the MAC 2 information is legal, it is determined that the transaction is completed, and new transaction information is generated; if the MAC 2 information is not legal, the transaction is considered not to occur, and if it is further determined that there is a combined wallet in the smart card other than the wallet The other wallet is re-traded for the wallet other than the wallet in the combined wallet.
10、 按照权利要求 9所述的终端, 其中, 所述异常处理模块还包括第二 异常处理单元, 其中:  10. The terminal according to claim 9, wherein the exception processing module further comprises a second exception processing unit, wherein:
所述第二异常处理单元设置为, 在所述交易进行模块发生断电异常并在 上电后, 读取所述数据库模块中备份的所述钱包的交易状态, 若判断出交易 状态为交易完成, 则根据交易信息判断当前的钱包是否处于交易进行中, 如 果当前的钱包处于交易中,则指示所述交易进行模块进行第一断电异常处理; 若判断出智能卡存在组合钱包交易, 则指示所述交易进行模块进行第二断电 异常处理;  The second abnormality processing unit is configured to: when the transaction execution module generates a power failure abnormality and after powering on, read the transaction status of the wallet backed up in the database module, and if the transaction status is determined to be a transaction completion And determining, according to the transaction information, whether the current wallet is in the process of conducting, if the current wallet is in the transaction, instructing the transaction performing module to perform the first power failure abnormality processing; if it is determined that the smart card has the combined wallet transaction, the indication The transaction execution module performs the second power failure exception processing;
所述交易进行模块还设置为, 根据所述第一断电异常处理的指示, 将智 能卡重新放入感应区域内, 并判断该钱包当前的交易状态是否为交易完成, 如果该钱包当前的交易状态为交易完成, 则存储交易异常的记录, 同时终止 后续钱包的交易; 和 /或根据所述第二断电异常处理的指示, 存储智能卡组合 钱包中除所述钱包外的钱包已完成的交易信息, 对于未完成交易的钱包则进 行重新交易初始化的处理。 The transaction performing module is further configured to: re-input the smart card into the sensing area according to the instruction of the first power-off abnormality processing, and determine whether the current transaction status of the wallet is a transaction completion, If the current transaction status of the wallet is a transaction completion, storing a record of the transaction abnormality, and terminating the transaction of the subsequent wallet; and/or storing the smart card combination wallet in addition to the wallet according to the indication of the second power failure abnormality processing The completed transaction information of the wallet, and the re-transaction initialization process for the wallet that has not completed the transaction.
PCT/CN2010/074167 2010-04-12 2010-06-21 Non-contact card terminal and abnormal state processing method thereof WO2011127687A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201010146454A CN101807320A (en) 2010-04-12 2010-04-12 Terminal aiming at non-contact intelligent card and method thereof for processing abnormality
CN201010146454.1 2010-04-12

Publications (1)

Publication Number Publication Date
WO2011127687A1 true WO2011127687A1 (en) 2011-10-20

Family

ID=42609101

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2010/074167 WO2011127687A1 (en) 2010-04-12 2010-06-21 Non-contact card terminal and abnormal state processing method thereof

Country Status (2)

Country Link
CN (1) CN101807320A (en)
WO (1) WO2011127687A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020197783A1 (en) * 2019-03-25 2020-10-01 Capital One Services, Llc Systems and methods for increased efficiency and reliability of contactless card transactions

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103440175A (en) * 2013-08-06 2013-12-11 北京数码视讯科技股份有限公司 Method and device for handling exception of intelligent card
CN103646467B (en) * 2013-12-24 2019-07-23 拉卡拉支付股份有限公司 A kind of logic encryption card offline transaction data processing method and device
CN103678043A (en) * 2013-12-26 2014-03-26 东信和平科技股份有限公司 Offline terminal transaction data backup method and system used in payment system
CN105069617B (en) * 2015-07-27 2018-10-12 飞天诚信科技股份有限公司 A kind of method and apparatus for restoring imperfect transaction
CN106297073B (en) * 2016-07-29 2018-12-11 深圳怡化电脑股份有限公司 A kind of self-aided terminal method for processing business and system
CN106960345B (en) * 2017-04-05 2020-05-05 恒宝股份有限公司 Internet of things card and working method thereof
CN110647363B (en) * 2018-06-27 2020-12-25 北京三快在线科技有限公司 Abnormity prompting method and device, storage medium and electronic equipment
CN109637010B (en) * 2018-12-06 2021-02-02 深圳怡化电脑股份有限公司 Financial terminal, and business processing method and system of financial terminal
CN109685190B (en) * 2018-12-28 2022-04-12 江苏恒宝智能系统技术有限公司 Power-down protection method and device for IC card

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11203433A (en) * 1998-01-20 1999-07-30 Shinko Electric Co Ltd Non-contact type ic card system and method for processing trouble in the ic card system
WO2001001340A1 (en) * 1999-06-29 2001-01-04 Hitachi, Ltd. Composite ic card
EP1128339A2 (en) * 2000-02-09 2001-08-29 Sony Corporation Electronic money system and electronic money terminal
CN1369853A (en) * 2001-12-25 2002-09-18 航天信息股份有限公司 Anti-pulling method for non-contact logic encryption card terminal
CN101226604A (en) * 2007-01-19 2008-07-23 东信和平智能卡股份有限公司 Smart card and data write-in method
CN101321341A (en) * 2008-07-11 2008-12-10 东信和平智能卡股份有限公司 Smart card power-off protection method
CN101645184A (en) * 2009-09-10 2010-02-10 北京握奇数据系统有限公司 Extension method and device of multiple wallets, and transaction initiation method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101226662A (en) * 2008-02-02 2008-07-23 上海鲁能中卡系统集成有限公司 Method for processing indeterminacy transaction record of non-contacting intelligent card

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11203433A (en) * 1998-01-20 1999-07-30 Shinko Electric Co Ltd Non-contact type ic card system and method for processing trouble in the ic card system
WO2001001340A1 (en) * 1999-06-29 2001-01-04 Hitachi, Ltd. Composite ic card
EP1128339A2 (en) * 2000-02-09 2001-08-29 Sony Corporation Electronic money system and electronic money terminal
CN1369853A (en) * 2001-12-25 2002-09-18 航天信息股份有限公司 Anti-pulling method for non-contact logic encryption card terminal
CN101226604A (en) * 2007-01-19 2008-07-23 东信和平智能卡股份有限公司 Smart card and data write-in method
CN101321341A (en) * 2008-07-11 2008-12-10 东信和平智能卡股份有限公司 Smart card power-off protection method
CN101645184A (en) * 2009-09-10 2010-02-10 北京握奇数据系统有限公司 Extension method and device of multiple wallets, and transaction initiation method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020197783A1 (en) * 2019-03-25 2020-10-01 Capital One Services, Llc Systems and methods for increased efficiency and reliability of contactless card transactions
US11227280B2 (en) 2019-03-25 2022-01-18 Capital One Services, Llc Systems and methods for increased efficiency and reliability of contactless card transactions

Also Published As

Publication number Publication date
CN101807320A (en) 2010-08-18

Similar Documents

Publication Publication Date Title
WO2011127687A1 (en) Non-contact card terminal and abnormal state processing method thereof
KR101604009B1 (en) Hardware Security Module for Certification and Processing Method thereof
CN102542453B (en) Mobile payment identity verification method
US10133773B2 (en) Methods and systems for indirectly retrieving account data from data storage devices
EP2880610A1 (en) Managing devices associated with a digital wallet account
BR112012017880A2 (en) "method and system"
US20100312681A1 (en) Electronic value exchange system, terminal device, recovery device and method of exchanging electronic value adoptable thereto
CN101937349A (en) Wireless communication terminal and software upgrading method thereof
CN101278299A (en) Computing system feature activation mechanism
CN110880113A (en) Authentication server and authentication method for block chain transaction
CN104504567A (en) Recharge method and device of micro-payment card
CN103646326A (en) Method and device for providing payment on payment platform
CN104867009A (en) Intelligent card, quota control system thereof, and quota control method thereof
CN109801071A (en) Password remapping method and device
CN107077556A (en) The prevention of security attack is exchanged to the cable of storage device
CN102799931A (en) Data protection method of radio frequency smart card
CN107844305A (en) The method for upgrading software and embedded device of embedded device
JP2003233874A (en) Settling system
TWI694391B (en) Method and device for realizing payment based on radio frequency identification technology
JP4692446B2 (en) Electronic money system and control method thereof
CN103605939A (en) Method, device and system for writing personal data in financial IC card
CN108647971A (en) Account safety method and smart card system in a kind of user payment
CN104182258A (en) Device and method for upgrading POS (point-of-sale) terminals
WO2018049851A1 (en) Payment method, mobile terminal and nfc terminal
WO2007076705A1 (en) A method and system for realizing the small consumption by the rfid mobile terminal and the process of reporting the loss

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 10849696

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 10849696

Country of ref document: EP

Kind code of ref document: A1