技术领域technical field
本发明涉及移动支付领域,尤其涉及一种公交IC卡联机交易方法及装置、计算机可读存储介质。The present invention relates to the field of mobile payment, in particular to a method and device for online transaction of a bus IC card, and a computer-readable storage medium.
背景技术Background technique
非接触式集成电路(Integrated Circuit,IC)卡又称为射频卡,由IC芯片以及感应天线组成。公交IC卡是采用IC技术并基于交通部或各地市自行制定的公共交通IC卡电子钱包技术规范的非接触式IC卡。A contactless integrated circuit (Integrated Circuit, IC) card, also called a radio frequency card, is composed of an IC chip and an induction antenna. The bus IC card is a non-contact IC card that adopts IC technology and is based on the public transport IC card electronic wallet technical specifications formulated by the Ministry of Communications or local cities.
随着共享单车的兴起,在共享单车上安装脱机的公交POS机,使用公交IC卡进行共享单车的支付成为一种常用的支付方式。每个城市的公交IC卡中保存的充值、消费等交易密钥是由对应城市的发卡方管理。With the rise of shared bicycles, offline bus POS machines are installed on shared bicycles, and the use of bus IC cards to pay for shared bicycles has become a common payment method. The transaction keys such as recharge and consumption stored in the bus IC card of each city are managed by the card issuer of the corresponding city.
在进行脱机交易时,在发卡方单独发行的销售点终端安全存取模块(PurchaseSecure Access Module,PSAM)中保存有交易密钥。通过公交IC卡、公交POS机以及服务器之间一系列的数据交互,实现公交IC卡的支付。由于一张PSAM卡仅支持一个发卡方发行的公交IC卡,因此,公交POS机通常不支持多个发卡方发行的公交IC卡,因此无法实现在不同的城市适用同一张公交IC卡进行共享单车支付。When performing an offline transaction, a transaction key is stored in a point-of-sale terminal security access module (Purchase Secure Access Module, PSAM) issued by the card issuer alone. Through a series of data interaction between bus IC card, bus POS machine and server, the payment of bus IC card is realized. Since a PSAM card only supports bus IC cards issued by one issuer, bus POS machines usually do not support bus IC cards issued by multiple card issuers, so it is impossible to use the same bus IC card for sharing bicycles in different cities. pay.
在进行联机交易时,交易密钥以及交易数据均由后台服务器提供,公交IC卡在交易时的所有指令都由后台服务器下发,所有返回结果都需要上传到后台服务器验证,通信次数较多。由于共享单车的投放不固定,共享单车所处环境的信号质量可能较差,导致解锁时间较长,解锁失败率较高。When conducting online transactions, the transaction key and transaction data are provided by the backend server. All the instructions of the bus IC card during the transaction are issued by the backend server. All the returned results need to be uploaded to the backend server for verification, and the number of communications is large. Since the delivery of shared bicycles is not fixed, the signal quality of the environment where the shared bicycles are located may be poor, resulting in a longer unlocking time and a higher unlocking failure rate.
发明内容SUMMARY OF THE INVENTION
本发明实施例解决的是如何降低使用公交IC卡解锁共享单车的时间,提高解锁成功率。The embodiment of the present invention solves how to reduce the time for unlocking the shared bicycle by using the bus IC card, and improve the unlocking success rate.
为解决上述技术问题,本发明实施例提供一种公交IC卡联机交易方法,包括:当检测到公交IC卡时,读取所述公交IC卡的信息;根据所述公交IC卡的信息生成交易申请,并将所述交易申请发送至服务器;接收所述服务器下发的交易密钥以及交易过程数据;所述交易密钥为所述服务器向所述公交IC卡发卡方请求获取;根据所述交易过程数据以及所述交易密钥生成交易指令;向所述公交IC卡发送交易指令,并验证所述公交IC卡反馈的交易结果;当所述交易结果为交易成功时,向车锁控制单元输出开锁命令以开启车锁。In order to solve the above technical problems, an embodiment of the present invention provides an online transaction method for a bus IC card, including: when a bus IC card is detected, reading the information of the bus IC card; generating a transaction according to the information of the bus IC card application, and send the transaction application to the server; receive the transaction key and transaction process data issued by the server; the transaction key is obtained by the server requesting the bus IC card issuer; according to the The transaction process data and the transaction key generate a transaction instruction; send a transaction instruction to the bus IC card, and verify the transaction result fed back by the bus IC card; when the transaction result is a successful transaction, send a transaction instruction to the car lock control unit Output the unlock command to unlock the car.
可选的,在验证所述交易结果为交易成功后,还包括:向所述服务器反馈所述交易结果。Optionally, after verifying that the transaction result is a successful transaction, the method further includes: feeding back the transaction result to the server.
可选的,所述公交IC卡联机交易方法还包括:接收所述服务器下发的更新的发卡方交易预处理脚本文件;向所述服务器反馈接收结果。Optionally, the bus IC card online transaction method further includes: receiving an updated card issuer transaction preprocessing script file issued by the server; and feeding back the receiving result to the server.
可选的,在检测公交IC卡之前,还包括:接收所述服务器下发的虚拟POS应用安装文件以及安装指令;安装所述虚拟POS应用安装文件。Optionally, before detecting the bus IC card, the method further includes: receiving a virtual POS application installation file and an installation instruction issued by the server; and installing the virtual POS application installation file.
可选的,在检测到公交IC卡之后,所述公交IC卡联机交易方法还包括:当未读取到所述公交IC卡对应的发卡方交易预处理脚本中指定的文件时,输出交易失败指示信号。Optionally, after the bus IC card is detected, the online transaction method for the bus IC card further includes: when the file specified in the transaction preprocessing script of the issuer corresponding to the bus IC card is not read, outputting the transaction fails. indication signal.
可选的,所述公交IC卡联机交易方法还包括:接收所述服务器发送的用于对所述交易密钥进行解密的维护密钥并存储;所述维护密钥为所述服务器向所述公交IC卡发卡方请求获取。Optionally, the bus IC card online transaction method further includes: receiving and storing a maintenance key sent by the server for decrypting the transaction key; the maintenance key is a message sent by the server to the The bus IC card issuer requests to obtain it.
一种公交IC卡联机交易装置,包括:读取单元,用于当检测到公交IC卡时,读取所述公交IC卡的信息;第一发送单元,用于根据所述公交IC卡的信息生成交易申请,并将所述交易申请发送至服务器;接收单元,用于接收所述服务器下发的交易密钥以及交易过程数据;所述交易密钥为所述服务器向所述公交IC卡发卡方请求获取;生成单元,用于根据所述交易过程数据以及所述交易密钥生成交易指令;第二发送单元,用于向所述公交IC卡发送交易指令;验证单元,用于验证所述公交IC卡反馈的交易结果;第三发送单元,用于当所述交易结果为交易成功时,向车锁控制单元输出开锁命令以开启车锁。An online transaction device for a bus IC card, comprising: a reading unit for reading the information of the bus IC card when the bus IC card is detected; a first sending unit for reading the information of the bus IC card according to the information of the bus IC card Generate a transaction application, and send the transaction application to the server; a receiving unit is used to receive the transaction key and transaction process data issued by the server; the transaction key is the server to issue a card to the bus IC card a generating unit for generating transaction instructions according to the transaction process data and the transaction key; a second sending unit for sending transaction instructions to the bus IC card; a verification unit for verifying the The transaction result fed back by the bus IC card; the third sending unit is configured to output an unlock command to the vehicle lock control unit to unlock the vehicle when the transaction result is a successful transaction.
可选的,所述第一发送单元,还用于向所述服务器反馈所述交易结果。Optionally, the first sending unit is further configured to feed back the transaction result to the server.
可选的,所述接收单元,还用于接收所述服务器下发的更新的发卡方交易预处理脚本文件;所述第一发送单元,还用于向所述服务器反馈接收结果。Optionally, the receiving unit is further configured to receive the updated card issuer transaction preprocessing script file issued by the server; the first sending unit is further configured to feed back the receiving result to the server.
可选的,所述公交IC卡联机交易装置还包括:安装单元,用于接收所述服务器下发的虚拟POS应用安装文件以及安装指令,并安装所述虚拟POS应用安装文件。Optionally, the bus IC card online transaction device further includes: an installation unit, configured to receive a virtual POS application installation file and an installation instruction issued by the server, and install the virtual POS application installation file.
可选的,所述公交IC卡联机交易装置还包括:输出单元,用于当所述读取单元未读取到所述公交IC卡对应的发卡方交易预处理脚本中指定的文件时,输出交易失败指示信号。Optionally, the bus IC card online transaction device further includes: an output unit, configured to output the file specified in the transaction preprocessing script of the issuer corresponding to the bus IC card when the reading unit fails to read the file. Trade failure indicator signal.
可选的,所述接收单元,还用于接收所述服务器发送的用于对所述交易密钥进行解密的维护密钥并存储;所述维护密钥为所述服务器向所述公交IC卡发卡方请求获取。Optionally, the receiving unit is further configured to receive and store the maintenance key sent by the server for decrypting the transaction key; the maintenance key is the transfer key sent by the server to the bus IC card. The card issuer requests access.
本发明实施例还提供了一种计算机可读存储介质,其上存储有计算机指令,所述计算机指令运行时执行上述任一种所述的公交IC卡联机交易方法的步骤。Embodiments of the present invention further provide a computer-readable storage medium, on which computer instructions are stored, and when the computer instructions are executed, the steps of any one of the above-mentioned online bus IC card transaction methods are executed.
本发明实施例还提供了另一种公交IC卡联机交易装置,包括存储器和处理器,所述存储器上存储有计算机指令,所述计算机指令运行时执行上述任一种所述的公交IC卡联机交易方法的步骤。The embodiment of the present invention also provides another bus IC card online transaction device, including a memory and a processor, wherein the memory stores computer instructions, and the computer instructions execute any of the above-mentioned bus IC card online transactions when running. The steps of the trading method.
与现有技术相比,本发明实施例的技术方案具有以下有益效果:Compared with the prior art, the technical solutions of the embodiments of the present invention have the following beneficial effects:
公交IC卡联机交易装置在使用公交IC卡进行共享单车的支付时,在交易过程中,向服务器发送交易申请,根据服务器下发的交易过程数据以及交易密钥生成交易指令,并将交易指令发送至公交IC卡。当检测到公交IC卡反馈的交易结果为交易成功时,向车锁控制单元输出开锁命令以开启车锁,从而实现共享单车的开锁及扣费。在整个交易过程中,只需要与服务器进行一次通信即可,无需每执行一步均与服务器进行通信,从而减少公交IC卡联机交易过程中与服务器的通信次数,因此可以降低公交IC卡解锁共享单车的时间,提高解锁成功率。When the bus IC card online transaction device uses the bus IC card to pay for shared bicycles, during the transaction process, it sends a transaction application to the server, generates a transaction instruction according to the transaction process data and transaction key sent by the server, and sends the transaction instruction. to the bus IC card. When it is detected that the transaction result fed back by the bus IC card is a successful transaction, an unlock command is output to the lock control unit to unlock the vehicle, thereby realizing the unlocking and deduction of the shared bicycle. In the entire transaction process, only one communication with the server is required, and there is no need to communicate with the server every step of execution, thereby reducing the number of communications with the server during the online transaction of the bus IC card, so it can reduce the number of times the bus IC card unlocks shared bicycles time to improve the unlocking success rate.
进一步,接收服务器下发的更新的发卡方交易预处理脚本文件,可以对支持的发卡方进行扩展,从而可以支持多个不同的发卡方发行的公交IC卡的交易,从而可以实现在不同的城市使用同一张公交IC卡。Further, by receiving the updated card issuer transaction preprocessing script file issued by the server, the supported card issuers can be expanded, so as to support the transactions of bus IC cards issued by multiple different card issuers, so as to realize the transaction in different cities. Use the same bus IC card.
此外,通过接收服务器下发的更新的发卡方交易预处理脚本文件,更新已经存储的发卡方交易预处理脚本文件,从而可以直接通过服务器进行维护,而无需再对公交IC卡联机交易装置进行维护,从而降低公交IC卡联机交易装置的维护成本。In addition, by receiving the updated card issuer transaction preprocessing script file issued by the server, the stored card issuer transaction preprocessing script file is updated, so that maintenance can be performed directly through the server, without the need to maintain the bus IC card online transaction device. , thereby reducing the maintenance cost of the bus IC card online transaction device.
附图说明Description of drawings
图1是本发明实施例中的一种公交IC卡联机交易系统的结构示意图;1 is a schematic structural diagram of a bus IC card online transaction system in an embodiment of the present invention;
图2是本发明实施例中的一种公交IC卡联机交易方法的流程图;Fig. 2 is a flow chart of a method for online transaction of a bus IC card in an embodiment of the present invention;
图3是本发明实施例中的另一种公交IC卡联机交易方法的流程图;3 is a flowchart of another method for online transaction of public transport IC cards in an embodiment of the present invention;
图4是本发明实施例中的一种公交IC卡联机交易装置的结构示意图。FIG. 4 is a schematic structural diagram of a bus IC card online transaction device in an embodiment of the present invention.
具体实施方式Detailed ways
现有技术中,在使用公交IC卡进行支付时,支付方式通常包括以下两种:脱机交易、联机交易。In the prior art, when using the bus IC card for payment, the payment methods usually include the following two types: offline transaction and online transaction.
在进行脱机交易时,通过公交IC卡、公交POS机以及服务器之间一系列的数据交互,实现公交IC卡的支付。由于一张PSAM卡仅支持一个发卡方发行的公交IC卡,因此,公交POS机中需要设置多张PSAM卡才能支持多个发卡方发行的公交IC卡。为使得公交POS机能够支持多个发卡方发行的公交IC卡,公交POS机可以进行联机交易。When conducting offline transactions, a series of data interactions between the bus IC card, the bus POS machine and the server are used to realize the payment of the bus IC card. Since a PSAM card only supports bus IC cards issued by one card issuer, multiple PSAM cards need to be set in the bus POS machine to support bus IC cards issued by multiple card issuers. In order to enable the bus POS machine to support bus IC cards issued by multiple card issuers, the bus POS machine can conduct online transactions.
在进行联机交易时,交易密钥以及交易数据均由后台服务器提供,公交IC卡在交易时的所有指令都由后台服务器下发,所有返回结果都需要上传到后台服务器验证,通信次数较多。在移动通信环境下,由于共享单车的投放不固定,共享单车所处环境的信号质量可能较差,导致解锁时间较长,解锁失败率较高。When conducting online transactions, the transaction key and transaction data are provided by the backend server. All the instructions of the bus IC card during the transaction are issued by the backend server. All the returned results need to be uploaded to the backend server for verification, and the number of communications is large. In the mobile communication environment, since the delivery of shared bicycles is not fixed, the signal quality of the environment in which the shared bicycles are located may be poor, resulting in a longer unlocking time and a higher unlocking failure rate.
在本发明实施例中,在整个交易过程中,公交IC卡联机交易装置要与服务器进行一次通信即可,无需每执行一步均与服务器进行通信,从而减少公交IC卡联机交易过程中与服务器的通信次数,因此可以降低公交IC卡解锁共享单车的时间,提高解锁成功率。In the embodiment of the present invention, in the entire transaction process, the bus IC card online transaction device only needs to communicate with the server once, and does not need to communicate with the server every step of execution, thereby reducing the communication between the bus IC card online transaction process and the server. Therefore, it can reduce the time for the bus IC card to unlock the shared bicycle and improve the success rate of unlocking.
为使本发明的上述目的、特征和有益效果能够更为明显易懂,下面结合附图对本发明的具体实施例做详细的说明。In order to make the above objects, features and beneficial effects of the present invention more clearly understood, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
参照图1,给出了本发明实施例中的一种公交IC卡联机交易系统的结构示意图。图1中,公交IC卡联机交易系统可以包括服务器1、公交IC卡联机交易装置2。在实际应用中,公交IC卡联机交易装置2可以为公交POS机,还可以为其他能够执行IC卡交易的机器或装置。Referring to FIG. 1 , a schematic structural diagram of a bus IC card online transaction system in an embodiment of the present invention is given. In FIG. 1 , the bus IC card online transaction system may include a server 1 and a bus IC card online transaction device 2 . In practical applications, the bus IC card online transaction device 2 may be a bus POS machine, or may be other machines or devices capable of performing IC card transactions.
在具体实施中,服务器1可以包括第一通信接口11、业务接口12以及密钥管理接口13。第一通信接口11、业务接口12以及密钥管理接口13可以均相互独立,也可以集成在同一台设备上。例如,业务接口12可以通过网络通信、串口通信等方式与第一通信接口11以及密钥管理接口13连接,实现对第一通信接口11以及密钥管理接口13的访问。In a specific implementation, the server 1 may include a first communication interface 11 , a service interface 12 and a key management interface 13 . The first communication interface 11 , the service interface 12 and the key management interface 13 may all be independent of each other, or may be integrated on the same device. For example, the service interface 12 may be connected to the first communication interface 11 and the key management interface 13 through network communication, serial communication, etc., so as to realize access to the first communication interface 11 and the key management interface 13 .
公交IC卡联机交易装置2可以包括第二通信接口21、中央控制单元22、IC卡读写接口23、虚拟POS应用载体24、定位接口25以及车锁控制单元26。The bus IC card online transaction device 2 may include a second communication interface 21 , a central control unit 22 , an IC card read/write interface 23 , a virtual POS application carrier 24 , a positioning interface 25 and a car lock control unit 26 .
在实际应用中,第二通信接口21、中央控制单元22、IC卡读写接口23、虚拟POS应用载体24、定位接口25以及车锁控制单元26可以集成在同一台设备中,例如集成在同一台公交POS机中。当上述模块集成在同一台公交POS机中时,各模块之间可以通过设备中的内部接口实现通信。例如,各模块之间通过设备中的通信串口进行通信。In practical applications, the second communication interface 21, the central control unit 22, the IC card read/write interface 23, the virtual POS application carrier 24, the positioning interface 25 and the car lock control unit 26 can be integrated in the same device, for example, integrated in the same device. Taiwan bus POS machine. When the above modules are integrated in the same bus POS machine, communication between the modules can be realized through the internal interface in the device. For example, each module communicates through the communication serial port in the device.
在实际应用中,也可以将第二通信接口21、中央控制单元22、虚拟POS应用载体24、定位接口25以及车锁控制单元26集成在同一台设备中,IC卡读写接口23可以通过外设的方式与中央控制单元22连接。In practical applications, the second communication interface 21, the central control unit 22, the virtual POS application carrier 24, the positioning interface 25 and the car lock control unit 26 can also be integrated into the same device, and the IC card read-write interface 23 can be It is connected to the central control unit 22 in a way of setting.
当IC卡读写接口23没有集成在公交POS机中时,IC卡读写接口23可以通过USB接口或者其他串口与中央控制单元22进行通信。When the IC card reading and writing interface 23 is not integrated in the bus POS machine, the IC card reading and writing interface 23 can communicate with the central control unit 22 through a USB interface or other serial ports.
在具体实施中,虚拟POS应用载体24中可以存储有虚拟POS应用程序数据以及发卡方交易预处理脚本文件。在本发明实施例中,发卡方交易预处理脚本文件可以为:能够支持某一个发卡方发行的公交IC卡进行交易流程的文件。In a specific implementation, the virtual POS application carrier 24 may store the virtual POS application data and the card issuer transaction preprocessing script file. In the embodiment of the present invention, the transaction preprocessing script file of the card issuer may be a file that can support the transaction process of the bus IC card issued by a certain card issuer.
例如,当虚拟POS应用程序数据包括发卡方A的交易预处理脚本文件时,则公交IC卡联机交易装置2支持发卡方A发行的公交IC卡的交易。反之,当虚拟POS应用程序数据不包括发卡方A的交易预处理脚本文件时,则公交IC卡联机交易装置2不支持发卡方A发行的公交IC卡的交易。For example, when the virtual POS application data includes the transaction preprocessing script file of the card issuer A, the public transportation IC card online transaction device 2 supports the transaction of the public transportation IC card issued by the card issuer A. On the contrary, when the virtual POS application data does not include the transaction preprocessing script file of the card issuer A, the bus IC card online transaction device 2 does not support the transaction of the bus IC card issued by the card issuer A.
在具体实施中,虚拟POS应用载体24可以为公交IC卡联机交易装置2中的SD卡、SIM卡、安全内置单元(SE)等均有存储功能的部件,也可以为公交IC卡联机交易装置2中其他能够存储虚拟POS应用程序数据的存储器件。In a specific implementation, the virtual POS application carrier 24 can be a component with storage functions such as SD card, SIM card, security built-in unit (SE), etc. in the bus IC card online transaction device 2, or it can be a bus IC card online transaction device 2 other storage devices capable of storing virtual POS application data.
在具体实施中,公交IC卡联机交易装置2在工作时,可以由中央控制单元22从虚拟POS应用载体24中读取虚拟POS应用程序数据并执行,也即通过中央控制单元22来执行虚拟POS应用程序。In a specific implementation, when the bus IC card online transaction device 2 is working, the central control unit 22 can read the virtual POS application data from the virtual POS application carrier 24 and execute it, that is, the central control unit 22 executes the virtual POS application.
在具体实施中,服务器1可以预先向公交IC卡联机交易装置2下发虚拟POS应用安装文件以及安装指令。公交IC卡联机交易装置2可以通过第二通信接口21接收虚拟POS应用安装文件以及安装指令。公交IC卡联机交易装置2在接收到虚拟POS应用安装文件以及安装指令后,由中央控制单元22安装接收到的虚拟POS应用安装文件,并将虚拟POS应用安装文件对应的POS应用程序数据存储至虚拟POS应用载体24。In a specific implementation, the server 1 may issue a virtual POS application installation file and an installation instruction to the bus IC card online transaction device 2 in advance. The bus IC card online transaction device 2 can receive the virtual POS application installation file and installation instruction through the second communication interface 21 . After receiving the virtual POS application installation file and the installation instruction, the bus IC card online transaction device 2 installs the received virtual POS application installation file by the central control unit 22, and stores the POS application program data corresponding to the virtual POS application installation file in the Virtual POS application carrier 24 .
在工作过程中,公交IC卡联机交易装置2可以与服务器1进行通信。具体而言,公交IC卡联机交易装置2可以通过第二通信接口21与服务器1的第一通信接口11进行通信,从而实现公交IC卡联机交易装置2与服务器1的通信。During the working process, the bus IC card online transaction device 2 can communicate with the server 1 . Specifically, the bus IC card online transaction device 2 can communicate with the first communication interface 11 of the server 1 through the second communication interface 21 , so as to realize the communication between the bus IC card online transaction device 2 and the server 1 .
在实际应用中,第一通信接口11与第二通信接口21可以通过无线数据传输进行通信,也可以通过有线数据传输进行通信。例如,第一通信接口11与第二通信接口21基于传输控制协议/因特网协议(Transmission Control Protocol/Internet Protocol,TCP/IP)进行通信。又如,第一通信接口11与第二通信接口21基于2G、3G、4G、5G等移动通信技术进行通信。可以理解的是,第一通信接口11与第二通信接口21还可以采用其他的通信方式进行通信,此处不做赘述。In practical applications, the first communication interface 11 and the second communication interface 21 may communicate through wireless data transmission, or may communicate through wired data transmission. For example, the first communication interface 11 and the second communication interface 21 communicate based on Transmission Control Protocol/Internet Protocol (TCP/IP). For another example, the first communication interface 11 communicates with the second communication interface 21 based on mobile communication technologies such as 2G, 3G, 4G, and 5G. It can be understood that, the first communication interface 11 and the second communication interface 21 may also use other communication manners for communication, which will not be repeated here.
IC卡读写接口23与公交IC卡3之间的通信方式可以为接触式通信,也可以为非接触式通信。当公交IC卡3与IC卡读写接口23采用接触式通信时,接触式通信接口可以采用ISO 7816协议。当公交IC卡3与IC卡读写接口23采用非接触式通信时,IC卡与IC卡读写接口23可以采用13.56MHz高频通信方式进行通信,也可以通过2.45GHz微波通信方式进行通信。The communication mode between the IC card read-write interface 23 and the bus IC card 3 may be contact communication or non-contact communication. When the bus IC card 3 and the IC card read-write interface 23 use contact communication, the contact communication interface can use the ISO 7816 protocol. When the bus IC card 3 and the IC card read/write interface 23 use contactless communication, the IC card and the IC card read/write interface 23 can communicate by 13.56MHz high frequency communication, or by 2.45GHz microwave communication.
在具体实施中,服务器1中的业务接口12具有同时处理多公交IC卡联机交易装置2发送的交易请求的能力,也即可以同时为多个公交IC卡联机交易装置2提供服务。不同的公交IC卡联机交易装置2可以通过相同或者不同的通信方式与服务器1进行通信。In a specific implementation, the service interface 12 in the server 1 has the capability of processing transaction requests sent by multiple bus IC card online transaction devices 2 at the same time, that is, it can provide services for multiple bus IC card online transaction devices 2 at the same time. Different public bus IC card online transaction devices 2 can communicate with the server 1 through the same or different communication methods.
在具体实施中,服务器1中的业务接口12可以对虚拟POS应用载体24中的虚拟POS应用程序数据进行更新。例如,服务器1可以经由第一通信接口11向公交IC卡联机交易装置2发送更新的发卡方交易预处理脚本文件。公交IC卡联机交易装置2通过第二通信接口21接收更新的发卡方交易预处理脚本文件,并将虚拟POS应用载体24中的发卡方交易预处理脚本文件替换为更新的发卡方交易预处理脚本文件。In a specific implementation, the service interface 12 in the server 1 can update the virtual POS application data in the virtual POS application carrier 24 . For example, the server 1 may send the updated card issuer transaction preprocessing script file to the bus IC card online transaction device 2 via the first communication interface 11 . The bus IC card online transaction device 2 receives the updated card issuer transaction preprocessing script file through the second communication interface 21, and replaces the card issuer transaction preprocessing script file in the virtual POS application carrier 24 with the updated card issuer transaction preprocessing script document.
在本发明实施例中,预设的发卡方交易预处理脚本文件可以存储在虚拟POS应用载体24中,也可以存储在中央控制单元22自身所具有的存储空间中,也可以存储在公交IC卡联机交易装置2的其他存储器中。In the embodiment of the present invention, the preset card issuer transaction preprocessing script file may be stored in the virtual POS application carrier 24, may also be stored in the storage space of the central control unit 22 itself, or may be stored in the bus IC card in other memory of the online transaction device 2 .
在具体实施中,服务器1中的密钥管理接口13与业务接口12可以通过网络或者串口设备连接。密钥管理接口13可以为业务接口12提供密钥管理系统以及其他与交易相关的服务接口,例如IC卡黑名单、发卡方接口等。与公交IC卡联机交易装置2相关的交易密钥可以放置在密钥管理接口13中,以确保与公交IC卡联机交易装置2通信的安全性。In a specific implementation, the key management interface 13 and the service interface 12 in the server 1 may be connected through a network or a serial port device. The key management interface 13 can provide the business interface 12 with a key management system and other transaction-related service interfaces, such as IC card blacklist, card issuer interface, and the like. The transaction key related to the bus IC card online transaction device 2 can be placed in the key management interface 13 to ensure the security of communication with the bus IC card online transaction device 2 .
在具体实施中,定位接口25可以获取共享单车当前所处地理位置信息,并将共享单车当前所处地理位置信息输出至中央控制单元22。中央控制单元22可以将共享单车当前所处地理位置信息通过第二通信接口21发送至服务器1,以使得服务器1能够获知共享单车当前所处地理位置。In a specific implementation, the positioning interface 25 may acquire the current geographic location information of the shared bicycle, and output the current geographic location information of the shared bicycle to the central control unit 22 . The central control unit 22 may send the information on the current geographic location of the shared bicycle to the server 1 through the second communication interface 21, so that the server 1 can learn the current geographic location of the shared bicycle.
在具体实施中,机电锁车单元26可以与共享单车上的车锁连接。当由中央控制单元22执行虚拟POS应用程序时,机电锁车单元26可以与中央控制单元22连接。中央控制单元22可以将生成的开锁命令输出至机电锁车单元26,机电锁车单元26在接收到开锁命令后开启车锁,从而实现共享单车的解锁。In a specific implementation, the electromechanical lock unit 26 may be connected with a lock on the shared bicycle. The electromechanical car locking unit 26 may be connected to the central control unit 22 when the virtual POS application is executed by the central control unit 22 . The central control unit 22 may output the generated unlocking command to the electromechanical vehicle locking unit 26, and the electromechanical vehicle locking unit 26 unlocks the vehicle after receiving the unlocking command, thereby unlocking the shared bicycle.
参照图2,给出了本发明实施例中的一种公交IC卡联机交易方法,以下结合图1,并通过具体步骤进行详细说明。Referring to FIG. 2 , an online transaction method of a bus IC card in an embodiment of the present invention is given. The following is a detailed description of the method through specific steps with reference to FIG. 1 .
在具体实施中,参照图1,在公交IC卡联机交易装置2中,设置有虚拟POS应用载体24。在虚拟POS应用载体24中,预先存储有虚拟POS应用程序数据以及至少一个发卡方对应的发卡方交易预处理脚本文件。公交IC卡联机交易装置2在工作时,可以由中央控制单元22运行虚拟POS应用程序。In a specific implementation, referring to FIG. 1 , a virtual POS application carrier 24 is provided in the bus IC card online transaction device 2 . In the virtual POS application carrier 24, the virtual POS application data and the card issuer transaction preprocessing script file corresponding to at least one card issuer are pre-stored. When the bus IC card online transaction device 2 is working, the virtual POS application program can be run by the central control unit 22 .
步骤S201,当检测到公交IC卡时,读取所述公交IC卡的信息。Step S201, when a bus IC card is detected, read the information of the bus IC card.
在具体实施中,当公交IC卡与公交IC卡联机交易装置中的IC卡读写接口之间的通信方式为非接触通信时,公交IC卡联机交易装置中的IC卡读写接口可以检测在工作范围内是否存在公交IC卡。公交IC卡联机交易装置在检测到工作范围内存在公交IC卡之后,可以向中央控制单元发送触发信号,以告知中央控制单元当前检测到公交IC卡。中央控制单元在获知IC卡读写接口检测到公交IC卡之后,可以执行预交易脚本指令,读取公交IC卡的信息。In a specific implementation, when the communication mode between the bus IC card and the IC card read-write interface in the bus IC card online transaction device is non-contact communication, the IC card read-write interface in the bus IC card online transaction device can detect when Whether there is a bus IC card within the work area. After detecting that the bus IC card exists in the working range, the bus IC card online transaction device can send a trigger signal to the central control unit to inform the central control unit that the bus IC card is currently detected. After learning that the IC card read-write interface detects the bus IC card, the central control unit can execute the pre-transaction script instruction to read the information of the bus IC card.
例如,公交IC卡与IC卡读写接口通过13.56MHz高频通信进行通信,此时,IC卡读写接口为13.56MHz读写接口。当用户手持公交IC卡贴近IC卡读写接口时,IC卡读写接口检测到工作范围内存在公交IC卡,并读取公交IC卡的信息。公交IC卡与IC卡读写接口进行非接触式通信的工作原理可以参照现有的非接触式IC卡读写原理,本发明不做赘述。For example, the bus IC card communicates with the IC card read-write interface through 13.56MHz high-frequency communication. At this time, the IC card read-write interface is a 13.56MHz read-write interface. When the user holds the bus IC card close to the IC card read-write interface, the IC card read-write interface detects the bus IC card in the working range, and reads the bus IC card information. The working principle of the non-contact communication between the bus IC card and the IC card read-write interface can be referred to the existing non-contact IC card read-write principle, which is not repeated in the present invention.
当公交IC卡与IC卡读写接口为接触通信时,IC卡读写接口可以为接触式通信接口。当IC卡读写接口检测到有公交IC卡放入或插入时,即可读取公交IC卡的信息。When the bus IC card and the IC card read/write interface are in contact communication, the IC card read/write interface may be a contact communication interface. When the IC card read-write interface detects that a bus IC card is put in or inserted, the information of the bus IC card can be read.
在本发明实施例中,中央控制单元在获知IC卡读写接口检测到IC卡之后,可以根据预先存储的发卡方交易预处理脚本文件来读取IC卡的信息。在发卡方交易预处理脚本文件中,包括中央控制单元读取IC卡的信息的规则。换而言之,中央控制单元根据发卡方交易预处理脚本文件,来获知从IC卡中读取哪些信息。In the embodiment of the present invention, after learning that the IC card read-write interface detects the IC card, the central control unit can read the information of the IC card according to the pre-stored card issuer transaction preprocessing script file. In the transaction preprocessing script file of the card issuer, the rules for the central control unit to read the information of the IC card are included. In other words, the central control unit knows what information to read from the IC card according to the card issuer's transaction preprocessing script file.
在具体实施中,公交IC卡的信息可以包括IC卡的类型、IC卡的余额、IC卡的卡片序列号等信息。例如,公交IC卡为上海市公共交通卡股份有限公司发行的旅行卡,公交IC卡的信息包括:上海旅行卡、余额200元、卡片序列号为U123456789。In a specific implementation, the information of the bus IC card may include information such as the type of the IC card, the balance of the IC card, and the card serial number of the IC card. For example, the bus IC card is a travel card issued by Shanghai Public Transport Card Co., Ltd., and the information of the bus IC card includes: Shanghai travel card, the balance of 200 yuan, and the card serial number of U123456789.
可以理解的是,在实际应用中,公交IC卡联机交易装置所读取到的公交IC卡的信息还可以包括公交IC的其他信息,并不仅限于上述举例。It can be understood that, in practical applications, the information of the bus IC card read by the bus IC card online transaction device may also include other information of the bus IC, which is not limited to the above examples.
中央控制单元在读取到IC卡的信息之后,可以执行初始化交易指令并返回数据。After the central control unit reads the information of the IC card, it can execute the initialization transaction instruction and return the data.
在具体实施中,不同发卡方对应的发卡方交易预处理脚本文件可能不同,发卡方与发卡方交易预处理脚本文件可以是一一对应的关系。因此,当公交IC卡联机交易装置中仅存储一个发卡方对应的发卡方交易预处理脚本文件时,公交IC卡联机交易装置仅能支持一个发卡方对应的IC卡的交易;当公交IC卡联机交易装置中存储有多个发卡方对应的发卡方交易预处理脚本文件时,公交IC卡联机交易装置可以支持多个发卡方对应的IC卡的交易。In a specific implementation, the card issuer transaction preprocessing script files corresponding to different card issuers may be different, and the card issuer and the card issuer transaction preprocessing script files may be in a one-to-one correspondence. Therefore, when the bus IC card online transaction device only stores a card issuer transaction preprocessing script file corresponding to the issuer, the bus IC card online transaction device can only support the transaction of the IC card corresponding to one card issuer; when the bus IC card is online When the transaction preprocessing script file corresponding to multiple card issuers is stored in the transaction device, the bus IC card online transaction device can support transactions of IC cards corresponding to multiple card issuers.
因此,在本发明实施例中,可以在公交IC卡联机交易装置中预先存储有多个发卡方交易预处理脚本文件,从而使得公交IC卡联机交易装置能够支持多个发卡方发行的IC卡的交易。Therefore, in the embodiment of the present invention, a plurality of card issuer transaction preprocessing script files may be pre-stored in the bus IC card online transaction device, so that the bus IC card online transaction device can support IC cards issued by multiple card issuers. trade.
步骤S202,根据所述公交IC卡的信息生成交易申请,并将所述交易申请发送至服务器。Step S202, generating a transaction application according to the information of the bus IC card, and sending the transaction application to the server.
在具体实施中,中央控制单元在获取到公交IC卡的信息之后,可以根据读取到的公交IC卡的信息生成交易申请,并将所生成的交易申请发送至服务器。In a specific implementation, after acquiring the information of the bus IC card, the central control unit may generate a transaction application according to the read information of the bus IC card, and send the generated transaction application to the server.
在实际应用中,中央控制单元在向服务器发送交易申请之前,可以经由虚拟POS应用载体对交易申请进行加密。虚拟POS应用载体将加密后的交易申请输出至中央控制单元,由中央控制单元将加密后的交易申请发送至服务器。服务器在接收到加密的交易申请后,对加密的交易申请进行解密,从而得到公交IC卡联机交易装置发送的交易申请。In practical applications, before sending the transaction application to the server, the central control unit may encrypt the transaction application via the virtual POS application carrier. The virtual POS application carrier outputs the encrypted transaction application to the central control unit, and the central control unit sends the encrypted transaction application to the server. After receiving the encrypted transaction application, the server decrypts the encrypted transaction application, thereby obtaining the transaction application sent by the bus IC card online transaction device.
虚拟POS应用载体对交易申请所进行的加密算法可以为3DES_ECB算法,并结合报文鉴别码(Message Authentication Code,MAC)。相应地,服务器使用的解密算法也为3DES_ECB算法。可以理解的是,虚拟POS应用载体还可以采用其他加密方法对交易申请进行加密,服务器可以使用同样的解密方法对加密后的交易申请进行解密,具体的加解密方法此处不做赘述。The encryption algorithm performed by the virtual POS application carrier for the transaction application may be the 3DES_ECB algorithm, combined with a message authentication code (Message Authentication Code, MAC). Correspondingly, the decryption algorithm used by the server is also the 3DES_ECB algorithm. It can be understood that the virtual POS application carrier can also use other encryption methods to encrypt the transaction application, and the server can use the same decryption method to decrypt the encrypted transaction application, and the specific encryption and decryption methods are not repeated here.
步骤S203,接收所述服务器发送的交易过程数据以及交易密钥。Step S203, receiving the transaction process data and the transaction key sent by the server.
在具体实施中,服务器在接收到交易申请之后,可以向公交IC卡的发卡方服务器请求交易密钥。公交IC卡的发卡方服务器在接收到服务器发送的交易密钥请求后,即可向服务器发送交易密钥。在本发明实施例中,若无特别说明,所述的服务器为公交IC卡联机交易装置对应的服务器。In a specific implementation, after receiving the transaction application, the server may request the transaction key from the server of the issuer of the bus IC card. After receiving the transaction key request sent by the server, the issuer server of the bus IC card can send the transaction key to the server. In the embodiment of the present invention, unless otherwise specified, the server is a server corresponding to the bus IC card online transaction device.
步骤S204,根据所述交易过程数据以及所述交易密钥生成交易指令。Step S204, generating a transaction instruction according to the transaction process data and the transaction key.
在具体实施中,中央控制单元在接收到交易密钥后,可以根据交易过程数据以及交易密钥生成交易指令。In a specific implementation, after receiving the transaction key, the central control unit may generate a transaction instruction according to the transaction process data and the transaction key.
在实际应用中,交易过程数据可以包括本次交易过程的一些信息,例如本次交易过程的时间、地点、进行交易的公交IC卡联机交易装置的标识等信息。交易过程数据还可以包括本次交易过程中的其他一些数据,此处不做赘述。In practical applications, the transaction process data may include some information about the current transaction process, such as the time and location of the current transaction process, and the identification of the bus IC card online transaction device that conducts the transaction. The transaction process data may also include other data in the current transaction process, which will not be repeated here.
步骤S205,向所述公交IC卡发送所述交易指令,并验证所述公交IC卡反馈的交易结果。Step S205, sending the transaction instruction to the bus IC card, and verifying the transaction result fed back by the bus IC card.
在具体实施中,公交IC卡联机交易装置在生成交易指令后,即可将生成的交易指令发送至公交IC卡。公交IC卡在接收到交易指令后,可以生成与交易指令对应的交易结果。公交IC卡联机交易装置中的IC卡读写接口可以读取交易结果,中央控制单元可以验证交易结果。In a specific implementation, after generating the transaction instruction, the bus IC card online transaction device can send the generated transaction instruction to the bus IC card. After receiving the transaction instruction, the bus IC card can generate a transaction result corresponding to the transaction instruction. The IC card read-write interface in the bus IC card online transaction device can read the transaction result, and the central control unit can verify the transaction result.
步骤S206,当所述交易结果为交易成功时,向车锁控制单元输出开锁命令以开启车锁。Step S206, when the transaction result is that the transaction is successful, output an unlock command to the vehicle lock control unit to unlock the vehicle.
在具体实施中,当交易结果为交易成功时,中央控制单元可以向车锁控制单元输出开锁命令。车锁控制单元在接收到开锁命令后,即可开启车锁,从而实现共享单车解锁。In a specific implementation, when the transaction result is that the transaction is successful, the central control unit may output an unlock command to the vehicle lock control unit. After receiving the unlock command, the car lock control unit can unlock the car to unlock the shared bicycle.
在本发明实施例中,当交易结果为交易成功时,中央控制单元还可以将交易结果反馈至服务器,以告知服务器本次交易成功;当交易结果为交易失败时,中央控制单元可以重新执行步骤S201~步骤S206,直至完成交易。In this embodiment of the present invention, when the transaction result is a successful transaction, the central control unit may also feed back the transaction result to the server to inform the server that the transaction is successful; when the transaction result is a transaction failure, the central control unit may re-execute the steps S201 to step S206 until the transaction is completed.
在具体实施中,服务器还可以向公交IC卡联机交易装置发送更新的发卡方交易预处理脚本文件。公交IC卡联机交易装置在接收到发卡方交易预处理脚本文件之后,中央控制单元将虚拟POS应用载体中已经安装的发卡方交易预处理脚本文件,替换为当前接收到的发卡方交易预处理脚本文件,也即对虚拟POS应用载体中的数据进行更新。In a specific implementation, the server may also send the updated card issuer transaction preprocessing script file to the bus IC card online transaction device. After the bus IC card online transaction device receives the issuer transaction preprocessing script file, the central control unit replaces the issuer transaction preprocessing script file already installed in the virtual POS application carrier with the currently received issuer transaction preprocessing script file, that is, update the data in the virtual POS application carrier.
在对虚拟POS应用载体中的数据进行更新时,只需要服务器向公交IC卡联机交易装置发送更新的发卡方交易预处理脚本文件,由中央控制单元采用更新的发卡方交易预处理脚本文件替代已安装的发卡方交易预处理脚本文件即可。在整个过程中,无需对公交IC卡联机交易装置进行物理维护,因此可以有效降低公交IC卡联机交易装置的维护成本。When updating the data in the virtual POS application carrier, the server only needs to send the updated card issuer transaction preprocessing script file to the bus IC card online transaction device, and the central control unit uses the updated card issuer transaction preprocessing script file to replace the existing The installed card issuer transaction preprocessing script file is sufficient. In the whole process, there is no need to perform physical maintenance on the bus IC card online transaction device, so the maintenance cost of the bus IC card online transaction device can be effectively reduced.
在具体实施中,中央控制单元在完成发卡方交易预处理脚本文件的更新后,可以向服务器反馈接收结果,以告知服务器当前是否完成更新的发卡方交易预处理脚本文件的接收。In a specific implementation, after completing the update of the issuer's transaction preprocessing script file, the central control unit may feed back the reception result to the server to inform the server whether the updated card issuer's transaction preprocessing script file is currently received.
中央控制单元在向服务器反馈接收结果时,可以经由虚拟POS应用载体对接收结果进行加密处理,之后再由中央控制单元将加密后的接收结果反馈至服务器。服务器在接收到加密后的接收结果之后,采用对应的解密算法进行解密,从而获知接收结果。When the central control unit feeds back the reception result to the server, it can encrypt the reception result via the virtual POS application carrier, and then the central control unit feeds back the encrypted reception result to the server. After receiving the encrypted reception result, the server uses the corresponding decryption algorithm to decrypt, so as to obtain the reception result.
例如,虚拟POS应用载体采用3DES_ECB算法对接收结果进行加密,并将加密后的接收结果发送至中央控制单元。中央控制单元将加密后的接收结果发送至服务器。服务器在接收到经过3DES_ECB算法加密后的接收结果后,使用约定的密钥采用3DES_ECB算法对接收结果进行解密。For example, the virtual POS application carrier uses the 3DES_ECB algorithm to encrypt the received result, and sends the encrypted received result to the central control unit. The central control unit sends the encrypted reception result to the server. After receiving the received result encrypted by the 3DES_ECB algorithm, the server uses the agreed key to decrypt the received result by using the 3DES_ECB algorithm.
在具体实施中,当确定不存在公交IC卡对应的发卡方交易预处理脚本文件时,或未读取到公交IC卡对应的发卡方交易预处理脚本文件中指定的文件时,公交IC卡联机交易装置可以输出交易失败指示信号,以告知用户使用当前的公交IC卡联机交易装置无法对所使用的公交IC卡进行交易。In a specific implementation, when it is determined that the issuer transaction preprocessing script file corresponding to the bus IC card does not exist, or when the file specified in the card issuer transaction preprocessing script file corresponding to the bus IC card is not read, the bus IC card is online. The transaction device may output a transaction failure indication signal to inform the user that the current bus IC card online transaction device cannot conduct transactions with the used bus IC card.
当公交IC卡联机交易装置中设置有显示屏幕时,可以在显示屏幕上显示“不支持该公交IC卡交易”等字样,以提醒用户使用当前的公交IC卡联机交易装置无法进行交易。When a display screen is set in the bus IC card online transaction device, words such as "this bus IC card transaction is not supported" can be displayed on the display screen to remind the user that the current bus IC card online transaction device cannot conduct transactions.
在具体实施中,服务器还可以向公交IC卡联机交易装置发送更新的虚拟POS应用程序数据来更新交易流程。公交IC卡联机交易装置在接收到发卡方交易流程文件之后,中央控制单元将对已经安装的虚拟POS应用程序数据替换为当前接收到的虚拟POS应用程序数据,也即对虚拟POS应用程序数据进行更新。In a specific implementation, the server may also send updated virtual POS application data to the bus IC card online transaction device to update the transaction process. After the bus IC card online transaction device receives the card issuer's transaction process file, the central control unit will replace the installed virtual POS application data with the currently received virtual POS application data, that is, the virtual POS application data will be processed. renew.
在对虚拟POS应用程序数据进行更新时,只需要服务器向公交IC卡联机交易装置发送更新的虚拟POS应用程序数据,由中央控制单元采用虚拟POS应用程序数据替代已安装的虚拟POS应用程序数据即可。在整个过程中,无需对公交IC卡联机交易装置进行物理维护,因此可以有效降低公交IC卡联机交易装置的维护成本。When updating the virtual POS application data, the server only needs to send the updated virtual POS application data to the bus IC card online transaction device, and the central control unit replaces the installed virtual POS application data with the virtual POS application data. Can. In the whole process, there is no need to perform physical maintenance on the bus IC card online transaction device, so the maintenance cost of the bus IC card online transaction device can be effectively reduced.
在具体实施中,中央控制单元在完成虚拟POS应用程序数据的更新后,可以向服务器反馈接收结果,以告知服务器当前是否完成更新的虚拟POS应用程序数据的接收。In a specific implementation, after completing the update of the virtual POS application data, the central control unit may feed back the reception result to the server to inform the server whether the reception of the updated virtual POS application data is currently completed.
在具体实施中,服务器向公交IC卡联机交易装置发送的交易密钥可以是经过加密的交易密钥。此时,公交IC卡联机交易装置接收到的是经过加密后的交易密钥。为便于公交IC卡联机交易装置能够对接收到的加密的交易密钥进行解密,公交IC卡联机交易装置可以向公交IC卡发卡方发送维护密钥请求。服务器在接收到维护密钥请求后,可以向公交IC卡联机交易装置发送用于对加密的交易密钥进行解密的维护密钥。In a specific implementation, the transaction key sent by the server to the bus IC card online transaction device may be an encrypted transaction key. At this time, what the bus IC card online transaction device receives is the encrypted transaction key. In order for the bus IC card online transaction device to decrypt the received encrypted transaction key, the bus IC card online transaction device can send a maintenance key request to the bus IC card issuer. After receiving the maintenance key request, the server may send the maintenance key for decrypting the encrypted transaction key to the bus IC card online transaction device.
由此可见,在本发明实施例中,在整个交易过程中,公交IC卡联机交易装置只需要与服务器进行一次通信即可,无需每执行一步均与服务器进行通信,因此可以降低公交IC卡解锁共享单车的时间,提高解锁成功率。It can be seen that in the embodiment of the present invention, in the entire transaction process, the bus IC card online transaction device only needs to communicate with the server once, and does not need to communicate with the server every step of execution, so it can reduce the unlocking of the bus IC card. The time of sharing bicycles increases the success rate of unlocking.
下面通过具体举例,对本发明实施例中提供的公交IC卡联机交易方法进行说明。参照图3,给出了本发明实施例中的另一种公交IC卡联机交易方法,以下结合图1和图2进行说明。The online transaction method of the bus IC card provided in the embodiment of the present invention will be described below through specific examples. Referring to FIG. 3 , another method for online transaction of a bus IC card in an embodiment of the present invention is given, which will be described below with reference to FIG. 1 and FIG. 2 .
步骤S301,公交IC卡联机交易装置获取公交IC卡的信息。Step S301, the bus IC card online transaction device obtains the information of the bus IC card.
在具体实施中,可以由公交IC卡联机交易装置中的IC卡读写接口来读取处于其工作范围内的公交IC卡的信息。当用户手持公交IC卡进入IC卡读写接口的工作范围之内时,IC卡读写接口即可读取该公交IC卡的信息。IC卡读写接口将读取到的公交IC卡的信息发送至公交IC卡联机交易装置中的中央控制单元。In a specific implementation, the information of the bus IC card within its working range can be read by the IC card read-write interface in the bus IC card online transaction device. When the user holds the bus IC card and enters the working range of the IC card reading and writing interface, the IC card reading and writing interface can read the information of the bus IC card. The IC card read-write interface sends the read information of the bus IC card to the central control unit in the bus IC card online transaction device.
步骤S302,公交IC卡联机交易装置生成交易申请。Step S302, the bus IC card online transaction device generates a transaction application.
在具体实施中,公交IC卡联机交易装置中的中央控制单元可以根据获取到的IC卡的信息,生成与之对应的交易申请。In a specific implementation, the central control unit in the bus IC card online transaction device can generate a corresponding transaction application according to the acquired IC card information.
步骤S303,公交IC卡联机交易装置将交易申请发送至服务器。Step S303, the bus IC card online transaction device sends the transaction application to the server.
步骤S304,服务器向发卡方服务器发送交易密钥申请请求。Step S304, the server sends a transaction key application request to the card issuer server.
步骤S305,发卡方服务器向服务器发送交易密钥。Step S305, the card issuer server sends the transaction key to the server.
步骤S306,服务器向IC卡联机交易装置发送交易过程数据以及交易密钥。Step S306, the server sends the transaction process data and the transaction key to the IC card online transaction device.
步骤S307,公交IC卡联机交易装置生成交易指令。Step S307, the bus IC card online transaction device generates a transaction instruction.
步骤S308,公交IC卡联机交易装置将交易指令发送至公交IC卡。In step S308, the bus IC card online transaction device sends a transaction instruction to the bus IC card.
步骤S309,公交IC卡联机交易装置获取公交IC卡反馈的交易结果。Step S309, the bus IC card online transaction device obtains the transaction result fed back by the bus IC card.
步骤S310,公交IC卡联机交易装置验证交易结果。Step S310, the bus IC card online transaction device verifies the transaction result.
步骤S311,公交IC卡联机交易装置生成开锁命令并发送至车锁控制单元。Step S311, the bus IC card online transaction device generates an unlock command and sends it to the vehicle lock control unit.
在具体实施中,当公交IC卡联机交易装置中的中央控制单元验证获知交易结果为交易成功时,中央控制单元可以生成开锁命令并发送至车锁控制单元。车锁控制单元在接收到开锁命令后开启车锁。In a specific implementation, when the central control unit in the bus IC card online transaction device verifies and learns that the transaction result is a successful transaction, the central control unit can generate an unlock command and send it to the vehicle lock control unit. The lock control unit unlocks the vehicle after receiving the unlock command.
步骤S312,公交IC卡联机交易装置将交易结果反馈至服务器。Step S312, the bus IC card online transaction device feeds back the transaction result to the server.
在具体实施中,当公交IC卡联机交易装置中的中央控制单元验证获知交易结果为交易成功时,中央控制单元还可以将交易结果反馈至服务器,以使得服务器获知本次交易成功。In a specific implementation, when the central control unit in the bus IC card online transaction device verifies and learns that the transaction result is a successful transaction, the central control unit can also feed back the transaction result to the server, so that the server knows that the transaction is successful.
参照图4,给出了本发明实施例中的一种公交IC卡联机交易装置40,包括:读取单元401、第一发送单元402、接收单元403、生成单元404、第二发送单元405、验证单元406以及第三发送单元407,其中:4, a bus IC card online transaction device 40 in an embodiment of the present invention is given, including: a reading unit 401, a first sending unit 402, a receiving unit 403, a generating unit 404, a second sending unit 405, The verification unit 406 and the third sending unit 407, wherein:
读取单元401,用于当检测到公交IC卡时,读取所述公交IC卡的信息;The reading unit 401 is used to read the information of the public transportation IC card when the public transportation IC card is detected;
第一发送单元402,用于根据所述公交IC卡的信息生成交易申请,并将所述交易申请发送至服务器;a first sending unit 402, configured to generate a transaction application according to the information of the bus IC card, and send the transaction application to a server;
接收单元403,用于接收所述服务器下发的交易密钥以及交易过程数据;所述交易密钥为所述服务器向所述公交IC卡发卡方请求获取;Receiving unit 403, configured to receive the transaction key and transaction process data issued by the server; the transaction key is obtained by the server requesting the bus IC card issuer;
生成单元404,用于根据所述交易过程数据以及所述交易密钥生成交易指令;a generating unit 404, configured to generate a transaction instruction according to the transaction process data and the transaction key;
第二发送单元405,用于向所述公交IC卡发送交易指令;The second sending unit 405 is configured to send a transaction instruction to the bus IC card;
验证单元406,用于验证所述公交IC卡反馈的交易结果;A verification unit 406, configured to verify the transaction result fed back by the bus IC card;
第三发送单元407,用于当所述交易结果为交易成功时,向车锁控制单元输出开锁命令以开启车锁。The third sending unit 407 is configured to output an unlock command to the car lock control unit to unlock the car lock when the transaction result is that the transaction is successful.
在具体实施中,所述第一发送单元402,还可以用于向所述服务器反馈所述交易结果。In a specific implementation, the first sending unit 402 may also be configured to feed back the transaction result to the server.
在具体实施中,所述接收单元403,还用于接收所述服务器下发的更新的发卡方交易预处理脚本文件;所述第一发送单元,还用于向所述服务器反馈接收结果。In a specific implementation, the receiving unit 403 is further configured to receive the updated card issuer transaction preprocessing script file issued by the server; the first sending unit is further configured to feed back the receiving result to the server.
在具体实施中,所述公交IC卡联机交易装置40还可以包括:安装单元408,用于接收所述服务器下发的虚拟POS应用安装文件以及安装指令,并安装所述虚拟POS应用安装文件。In a specific implementation, the bus IC card online transaction device 40 may further include: an installation unit 408, configured to receive the virtual POS application installation file and installation instruction issued by the server, and install the virtual POS application installation file.
在具体实施中,所述公交IC卡联机交易装置40还可以包括:输出单元409,用于当所述读取单元401未读取到所述公交IC卡对应的发卡方交易预处理脚本中指定的文件时,输出交易失败指示信号。In a specific implementation, the bus IC card online transaction device 40 may further include: an output unit 409 for when the reading unit 401 fails to read the specified in the transaction preprocessing script of the issuer corresponding to the bus IC card file, output a transaction failure indication signal.
在具体实施中,所述接收单元403,还可以用于接收所述服务器发送的用于对所述交易密钥进行解密的维护密钥并存储;所述维护密钥为所述服务器向所述公交IC卡发卡方请求获取。In a specific implementation, the receiving unit 403 may also be configured to receive and store the maintenance key sent by the server for decrypting the transaction key; the maintenance key is the key sent by the server to the The bus IC card issuer requests to obtain it.
本发明实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质为非易失性介质或非瞬态介质,其上存储有计算机指令,所述计算机指令运行时执行本发明上述任一实施例中提供的公交IC卡联机交易方法的步骤,此处不做赘述。Embodiments of the present invention further provide a computer-readable storage medium, where the computer-readable storage medium is a non-volatile medium or a non-transitory medium, and has computer instructions stored thereon, and the computer instructions execute the present invention when running. The steps of the bus IC card online transaction method provided in any of the above embodiments will not be repeated here.
本发明实施例还提供了另一种公交IC卡联机交易装置,包括存储器和处理器,所述存储器上存储有计算机指令,所述计算机指令运行时执行本发明上述任一实施例中提供的公交IC卡联机交易方法的步骤,此处不做赘述。The embodiment of the present invention also provides another bus IC card online transaction device, including a memory and a processor, wherein the memory stores computer instructions, and the computer instructions execute the bus provided in any of the above embodiments of the present invention when running. The steps of the IC card online transaction method will not be repeated here.
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于一计算机可读存储介质中,存储介质可以包括:ROM、RAM、磁盘或光盘等。Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing relevant hardware through a program, and the program can be stored in a computer-readable storage medium, and the storage medium can include: ROM, RAM, magnetic disk or optical disk, etc.
虽然本发明披露如上,但本发明并非限定于此。任何本领域技术人员,在不脱离本发明的精神和范围内,均可作各种更动与修改,因此本发明的保护范围应当以权利要求所限定的范围为准。Although the present invention is disclosed above, the present invention is not limited thereto. Any person skilled in the art can make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention should be based on the scope defined by the claims.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201810125495.9ACN110119942A (en) | 2018-02-07 | 2018-02-07 | Bus IC card on-line transaction method and device, computer readable storage medium |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201810125495.9ACN110119942A (en) | 2018-02-07 | 2018-02-07 | Bus IC card on-line transaction method and device, computer readable storage medium |
| Publication Number | Publication Date |
|---|---|
| CN110119942Atrue CN110119942A (en) | 2019-08-13 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201810125495.9APendingCN110119942A (en) | 2018-02-07 | 2018-02-07 | Bus IC card on-line transaction method and device, computer readable storage medium |
| Country | Link |
|---|---|
| CN (1) | CN110119942A (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115102737A (en)* | 2022-06-15 | 2022-09-23 | 交通运输通信信息集团有限公司 | ESAM remote issuing method and system for traffic all-purpose card |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2008094328A2 (en)* | 2007-01-30 | 2008-08-07 | Visa U.S.A. Inc. | Signature based negative list for off line payment device validation |
| CN101908254A (en)* | 2010-08-23 | 2010-12-08 | 邓斌涛 | Intelligent card transaction platform, system and method |
| CN103295320A (en)* | 2013-05-06 | 2013-09-11 | 深圳市国民电子商务有限公司 | All-purpose card interconnection system and method |
| CN105023151A (en)* | 2015-07-22 | 2015-11-04 | 天地融科技股份有限公司 | Card transaction data processing method and device |
| CN107507309A (en)* | 2017-08-24 | 2017-12-22 | 东峡大通(北京)管理咨询有限公司 | A kind of shared bicycle method for unlocking and server |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2008094328A2 (en)* | 2007-01-30 | 2008-08-07 | Visa U.S.A. Inc. | Signature based negative list for off line payment device validation |
| CN101908254A (en)* | 2010-08-23 | 2010-12-08 | 邓斌涛 | Intelligent card transaction platform, system and method |
| CN103295320A (en)* | 2013-05-06 | 2013-09-11 | 深圳市国民电子商务有限公司 | All-purpose card interconnection system and method |
| CN105023151A (en)* | 2015-07-22 | 2015-11-04 | 天地融科技股份有限公司 | Card transaction data processing method and device |
| CN107507309A (en)* | 2017-08-24 | 2017-12-22 | 东峡大通(北京)管理咨询有限公司 | A kind of shared bicycle method for unlocking and server |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115102737A (en)* | 2022-06-15 | 2022-09-23 | 交通运输通信信息集团有限公司 | ESAM remote issuing method and system for traffic all-purpose card |
| CN115102737B (en)* | 2022-06-15 | 2024-05-14 | 交通运输通信信息集团有限公司 | ESAM remote issuing method and system for traffic all-purpose card |
| Publication | Publication Date | Title |
|---|---|---|
| US11240219B2 (en) | Hybrid integration of software development kit with secure execution environment | |
| EP3410376B1 (en) | Credit payment method and device based on card emulation of mobile terminal | |
| US20190122212A1 (en) | Methods and systems for provisioning payment credentials | |
| US9734091B2 (en) | Remote load and update card emulation support | |
| KR101492054B1 (en) | Card reader, terminal and method for processing payment information thereof | |
| US20070067634A1 (en) | System and method for restricting access to a terminal | |
| US20110078245A1 (en) | Method and a system for transferring application data from a source electronic device to a destination electronic device | |
| CN113344570A (en) | Method for transmitting and processing transaction message and data processing device | |
| WO2016106330A1 (en) | Software tampering detection and reporting process | |
| KR20110084865A (en) | Mobile credit card payment method and device using mobile ID and contact / contactless communication | |
| US11887022B2 (en) | Systems and methods for provisioning point of sale terminals | |
| CN104268746A (en) | Card-free payment method | |
| CN103577983A (en) | Load method of electronic currency for off-line consumption | |
| KR102292916B1 (en) | Midrange Reader Interactions | |
| JP2021175184A (en) | Contactless card with multiple rotating security keys | |
| KR101583156B1 (en) | Card reader, terminal and method for processing payment information thereof | |
| US20190279213A1 (en) | Method for processing transaction data, corresponding communications terminal, card reader and program | |
| CN104102934A (en) | Portable IC card read-write device, system and method | |
| KR101710950B1 (en) | Method for distributing encrypt key, card reader and system for distributing encrypt key thereof | |
| CN110119942A (en) | Bus IC card on-line transaction method and device, computer readable storage medium | |
| CN110119945A (en) | IC card on-line transaction method and device, computer readable storage medium | |
| KR101946330B1 (en) | A payment method providing sharing of secure application modules and an appratus using it | |
| US12124830B2 (en) | Method and system for configuring a mobile point-of-sales application | |
| EP2985724A1 (en) | Remote load and update card emulation support | |
| CN116097686A (en) | Secure end-to-end pairing of a secure element with a mobile device |
| 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 | ||
| RJ01 | Rejection of invention patent application after publication | ||
| RJ01 | Rejection of invention patent application after publication | Application publication date:20190813 |