Bus card processing method, device, equipment and readable storage medium

文档序号:21086 发布日期:2021-09-21 浏览:34次 中文

阅读说明:本技术 公交卡处理方法、装置、设备及可读存储介质 (Bus card processing method, device, equipment and readable storage medium ) 是由 董冬冬 于 2021-05-26 设计创作,主要内容包括:本发明公开了一种公交卡处理方法、装置、设备及可读存储介质,该方法包括:当检测到目标公交卡时,获取目标公交卡对应的目标公交卡ID和目标公交卡余额,并向目标公交卡对应的服务器发送密钥获取请求;接收服务器基于密钥获取请求发送的读密钥,并依据读密钥获取目标公交卡的当前交易密钥,以生成模拟公交卡;当基于模拟公交卡接收到目标交易请求时,获取目标交易请求对应的交易额,并根据读密钥和所述交易额,修改模拟公交卡对应的目标公交卡余额;将目标公交卡ID以及修改后的目标公交卡余额发送至服务器,完成目标公交卡的处理。本发明通过生成模拟公交卡,实现了在一张卡的基础上灵活使用多种支付方式。(The invention discloses a bus card processing method, a device, equipment and a readable storage medium, wherein the method comprises the following steps: when a target bus card is detected, acquiring the ID and the balance of the target bus card corresponding to the target bus card, and sending a key acquisition request to a server corresponding to the target bus card; receiving a key reading request sent by a server based on the key acquisition request, and acquiring a current transaction key of a target bus card according to the key reading request to generate a simulated bus card; when a target transaction request is received based on the simulated bus card, acquiring a transaction amount corresponding to the target transaction request, and modifying the balance of the target bus card corresponding to the simulated bus card according to the read key and the transaction amount; and sending the ID of the target bus card and the modified balance of the target bus card to a server to complete the processing of the target bus card. The invention realizes the flexible use of a plurality of payment modes on the basis of one card by generating the simulated bus card.)

1. A bus card processing method is characterized in that the bus card processing method is applied to a bus card simulation terminal, and comprises the following steps:

when a target bus card is detected, acquiring a target bus card ID and a target bus card balance corresponding to the target bus card, and sending a key acquisition request to a server corresponding to the target bus card;

receiving a key reading request sent by the server based on the key acquisition request, and acquiring a current transaction key of the target bus card according to the key reading request so as to generate a simulated bus card containing the ID of the target bus card, the balance of the target bus card and the current transaction key in the bus card simulation terminal;

when a target transaction request is received based on the simulated bus card, acquiring a transaction amount corresponding to the target transaction request, and modifying the balance of the target bus card corresponding to the simulated bus card according to the read key and the transaction amount;

and sending the ID of the target bus card and the balance of the modified target bus card to the server so that the server generates a new transaction key, receiving the new transaction key sent by the server, and replacing the current transaction key with the new transaction key to complete the processing of the target bus card.

2. The bus card processing method as claimed in claim 1, wherein the step of acquiring the target bus card ID and the target bus card balance corresponding to the target bus card and sending the key acquisition request to the server corresponding to the target bus card when the target bus card is detected comprises:

when a target bus card is detected, inquiring a target non-encrypted storage block corresponding to the target bus card, and reading a target bus card ID and a target bus card balance in the target non-encrypted storage block;

and inquiring a target encryption storage block corresponding to the target bus card, and sending a key acquisition request to a server corresponding to the target bus card.

3. The bus card processing method as claimed in claim 2, wherein the step of receiving the key reading request sent by the server based on the key obtaining request, and obtaining the current transaction key of the target bus card according to the key reading request, so as to generate the simulated bus card containing the ID of the target bus card, the balance of the target bus card and the current transaction key in the bus card simulation terminal comprises:

receiving a read key sent by the server, and reading a current transaction key in the target encrypted storage area block according to the read key;

generating a simulated bus card containing the ID of the target bus card, the balance of the target bus card and the current transaction key, wherein the ID of the target bus card and the balance of the target bus card are stored in a simulated non-encrypted storage block corresponding to the simulated bus card, and the current transaction key is stored in a simulated encrypted storage block corresponding to the simulated bus card.

4. The bus card processing method as set forth in claim 3, wherein the step of receiving the new transaction key sent by the server, replacing the current transaction key with the new transaction key, and completing the processing of the target bus card comprises:

receiving the new transaction key sent by the server, and storing the ID of the target bus card and the balance of the modified target bus card in the simulated non-encrypted storage block;

and storing the new transaction key in the simulated encryption storage block to finish the processing of the target bus card.

5. A bus card processing method is characterized by being applied to a bus card reader, and comprising the following steps:

when the simulated bus card is detected, sending a target transaction request to a bus card simulation terminal corresponding to the simulated bus card, and receiving a target bus card ID, a target bus card balance and a current transaction key sent by the bus card simulation terminal based on the target transaction request;

sending an inquiry request to a server corresponding to the simulated bus card based on the ID of the target bus card, and receiving a first bus card balance and a first transaction key sent by the server based on the inquiry request;

if the current transaction key is different from the first transaction key, sending a verification request to the server based on the current transaction key, and receiving a verification result sent by the server based on the verification request;

according to the verification result, transaction operation is carried out on the simulated bus card, a transaction amount corresponding to the transaction operation is obtained, and a second bus card balance is determined according to the first bus card balance and the transaction amount;

and sending the second bus card balance to the bus card simulation terminal and the server so that the bus card simulation terminal modifies the target bus card balance and the server modifies the first bus card balance.

6. A bus card processing method is characterized in that the bus card processing method is applied to a server, and comprises the following steps:

receiving an inquiry request sent by a bus card reader, and acquiring a target bus card ID corresponding to the inquiry request, and a first bus card balance and a first transaction key corresponding to the target bus card ID;

sending the first bus card balance and the first transaction key to the bus card reader, receiving a verification request sent by the bus card reader, and acquiring a current transaction key corresponding to the verification request;

inquiring preset transaction data, determining a verification result corresponding to the verification request according to the preset transaction data and the current transaction key, and sending the verification result to the bus card reader;

when a second bus card balance sent by a bus card simulation terminal is received based on the verification result, a second transaction key is generated, the first bus card balance is replaced by the second bus card balance, and the first transaction key is replaced by the second transaction key;

and sending the second transaction key to the bus card simulation terminal so that the bus card simulation terminal replaces the current transaction key with the second transaction key.

7. The bus card processing method as set forth in claim 6, wherein the step of determining the verification result corresponding to the verification request according to the preset transaction data and the current transaction key comprises:

acquiring a balance of a target bus card corresponding to the current transaction key from the bus card simulation terminal, and acquiring a transaction key set in the preset transaction data;

taking a transaction key in the transaction key set, which is the same as the current transaction key, as a third transaction key, and acquiring a third bus card balance corresponding to the third transaction key from the preset transaction data;

and if the balance of the target bus card is the same as that of the third bus card, determining that the verification result corresponding to the verification request is successful.

8. The utility model provides a bus card processing apparatus which characterized in that, bus card processing apparatus includes:

the system comprises a key acquisition request sending module, a key acquisition module and a key acquisition module, wherein the key acquisition request sending module is used for acquiring a target bus card ID and a target bus card balance corresponding to a target bus card and sending a key acquisition request to a server corresponding to the target bus card when the target bus card is detected;

the current transaction key acquisition module is used for receiving a read key sent by the server based on the key acquisition request, acquiring a current transaction key of the target bus card according to the read key, and generating a simulated bus card containing the ID of the target bus card, the balance of the target bus card and the current transaction key in the bus card simulation terminal;

the balance modifying module is used for acquiring a transaction amount corresponding to the target transaction request when the target transaction request is received based on the simulated bus card, and modifying the balance of the target bus card corresponding to the simulated bus card according to the read key and the transaction amount;

and the transaction key modification module is used for sending the ID of the target bus card and the balance of the modified target bus card to the server so that the server generates a new transaction key, receiving the new transaction key sent by the server, and replacing the current transaction key with the new transaction key to complete the processing of the target bus card.

9. The bus card processing device is characterized by comprising: a memory, a processor and a bus card processing program stored on the memory and executable on the processor, the bus card processing program when executed by the processor implementing the steps of the bus card processing method as claimed in any one of claims 1 to 7.

10. A readable storage medium, characterized in that the readable storage medium has stored thereon a bus card processing program, which when executed by a processor implements the steps of the bus card processing method according to any one of claims 1 to 7.

Technical Field

The invention relates to the field of intelligent wearing, in particular to a bus card processing method, device and equipment and a readable storage medium.

Background

With the rapid development of scientific technology, intelligent wearable devices have gradually entered people's lives, and existing intelligent wearable devices (such as smart bracelets) have mostly NFC (Near Field Communication) functions, and can generate electronic bus cards for taking buses in a networking state. However, in the transition from the payment of the physical bus card to the payment of the electronic bus card, people generally select the more convenient electronic bus card, under the circumstance, the physical bus card used by people is mostly abandoned, and people habitually carry the electronic bus card and the physical bus card at the same time, so that how to flexibly use a plurality of payment modes (the electronic bus card and/or the physical bus card) on the basis of one physical bus card becomes a technical problem to be solved urgently.

Disclosure of Invention

The invention mainly aims to provide a bus card processing method, a device, equipment and a readable storage medium, and aims to solve the technical problem that multiple payment modes cannot be flexibly used on the basis of one entity bus card.

In addition, in order to achieve the above object, the present invention provides a bus card processing method, which is applied to a bus card simulation terminal, and comprises the following steps:

when a target bus card is detected, acquiring an Identity Document (ID) of the target bus card and the balance of the target bus card corresponding to the target bus card, and sending a key acquisition request to a server corresponding to the target bus card;

receiving a key reading request sent by the server based on the key acquisition request, and acquiring a current transaction key of the target bus card according to the key reading request so as to generate a simulated bus card containing the ID of the target bus card, the balance of the target bus card and the current transaction key in the bus card simulation terminal;

when a target transaction request is received based on the simulated bus card, acquiring a transaction amount corresponding to the target transaction request, and modifying the balance of the target bus card corresponding to the simulated bus card according to the read key and the transaction amount;

and sending the ID of the target bus card and the balance of the modified target bus card to the server so that the server generates a new transaction key, receiving the new transaction key sent by the server, and replacing the current transaction key with the new transaction key to complete the processing of the target bus card.

Optionally, when a target bus card is detected, the step of obtaining the ID and the balance of the target bus card corresponding to the target bus card and sending a key obtaining request to a server corresponding to the target bus card includes:

when a target bus card is detected, inquiring a target non-encrypted storage block corresponding to the target bus card, and reading a target bus card ID and a target bus card balance in the target non-encrypted storage block;

and inquiring a target encryption storage block corresponding to the target bus card, and sending a key acquisition request to a server corresponding to the target bus card.

Optionally, the step of receiving a read key sent by the server based on the key acquisition request, and acquiring a current transaction key corresponding to the target bus card through the read key to generate a simulated bus card including the ID of the target bus card, the balance of the target bus card, and the current transaction key in the bus card simulation terminal includes:

receiving a read key sent by the server, and reading a current transaction key in the target encrypted storage area block according to the read key;

generating a simulated bus card containing the ID of the target bus card, the balance of the target bus card and the current transaction key, wherein the ID of the target bus card and the balance of the target bus card are stored in a simulated non-encrypted storage block corresponding to the simulated bus card, and the current transaction key is stored in a simulated encrypted storage block corresponding to the simulated bus card.

Optionally, the step of receiving the new transaction key sent by the server, replacing the current transaction key with the new transaction key, and completing the processing of the target bus card includes:

receiving the new transaction key sent by the server, and storing the ID of the target bus card and the balance of the modified target bus card in the simulated non-encrypted storage block;

and storing the new transaction key in the simulated encryption storage block to finish the processing of the target bus card.

Further, in order to achieve the above object, the present invention further provides a bus card processing method, which is applied to a bus card reader, and comprises the following steps:

when the simulated bus card is detected, sending a target transaction request to a bus card simulation terminal corresponding to the simulated bus card, and receiving a target bus card ID, a target bus card balance and a current transaction key sent by the bus card simulation terminal based on the target transaction request;

sending an inquiry request to a server corresponding to the simulated bus card based on the ID of the target bus card, and receiving a first bus card balance and a first transaction key sent by the server based on the inquiry request;

if the current transaction key is different from the first transaction key, sending a verification request to the server based on the current transaction key, and receiving a verification result sent by the server based on the verification request;

according to the verification result, transaction operation is carried out on the simulated bus card, a transaction amount corresponding to the transaction operation is obtained, and a second bus card balance is determined according to the first bus card balance and the transaction amount;

and sending the second bus card balance to the bus card simulation terminal and the server so that the bus card simulation terminal modifies the target bus card balance and the server modifies the first bus card balance.

Further, in order to achieve the above object, the present invention further provides a bus card processing method, wherein the bus card processing method is applied to a server, and the bus card processing method includes the following steps:

receiving an inquiry request sent by a bus card reader, and acquiring a target bus card ID corresponding to the inquiry request, and a first bus card balance and a first transaction key corresponding to the target bus card ID;

sending the first bus card balance and the first transaction key to the bus card reader, receiving a verification request sent by the bus card reader, and acquiring a current transaction key corresponding to the verification request;

inquiring preset transaction data, determining a verification result corresponding to the verification request according to the preset transaction data and the current transaction key, and sending the verification result to the bus card reader;

when a second bus card balance sent by a bus card simulation terminal is received based on the verification result, a second transaction key is generated, the first bus card balance is replaced by the second bus card balance, and the first transaction key is replaced by the second transaction key;

and sending the second transaction key to the bus card simulation terminal so that the bus card simulation terminal replaces the current transaction key with the second transaction key.

Optionally, the step of determining a verification result corresponding to the verification request according to the preset transaction data and the current transaction key includes:

acquiring a balance of a target bus card corresponding to the current transaction key from the bus card simulation terminal, and acquiring a transaction key set in the preset transaction data;

taking a transaction key in the transaction key set, which is the same as the current transaction key, as a third transaction key, and acquiring a third bus card balance corresponding to the third transaction key from the preset transaction data;

and if the balance of the target bus card is the same as that of the third bus card, determining that the verification result corresponding to the verification request is successful.

In addition, in order to achieve the above object, the present invention further provides a bus card processing apparatus, including:

the system comprises a key acquisition request sending module, a key acquisition module and a key acquisition module, wherein the key acquisition request sending module is used for acquiring a target bus card ID and a target bus card balance corresponding to a target bus card and sending a key acquisition request to a server corresponding to the target bus card when the target bus card is detected;

the current transaction key acquisition module is used for receiving a read key sent by the server based on the key acquisition request, acquiring a current transaction key of the target bus card according to the read key, and generating a simulated bus card containing the ID of the target bus card, the balance of the target bus card and the current transaction key in the bus card simulation terminal;

the balance modifying module is used for acquiring a transaction amount corresponding to the target transaction request when the target transaction request is received based on the simulated bus card, and modifying the balance of the target bus card corresponding to the simulated bus card according to the read key and the transaction amount;

and the transaction key modification module is used for sending the ID of the target bus card and the balance of the modified target bus card to the server so that the server generates a new transaction key, receiving the new transaction key sent by the server, and replacing the current transaction key with the new transaction key to complete the processing of the target bus card.

In addition, to achieve the above object, the present invention also provides a bus card processing apparatus, including: the bus card processing method comprises a memory, a processor and a bus card processing program which is stored on the memory and can run on the processor, wherein the steps of the bus card processing method are realized when the bus card processing program is executed by the processor.

In addition, in order to achieve the above object, the present invention further provides a readable storage medium, wherein the readable storage medium stores a bus card processing program, and the bus card processing program realizes the steps of the bus card processing method when being executed by a processor.

The embodiment of the invention provides a bus card processing method, a bus card processing device, bus card processing equipment and a readable storage medium. In the embodiment of the invention, when a bus card simulation terminal detects a target bus card, the bus card simulation terminal acquires a target bus card ID and a target bus card balance corresponding to the target bus card, sends a key acquisition request to a server corresponding to the target bus card, receives a read key sent by the server based on the key acquisition request, acquires a current transaction key of the target bus card according to the read key, generates a simulated bus card containing the target bus card ID, the target bus card balance and the current transaction key in the bus card simulation terminal, acquires a transaction amount corresponding to the target transaction request when the bus card simulation terminal receives the target transaction request based on the simulated bus card, modifies the target bus card balance corresponding to the simulated bus card according to the read key and the transaction amount, and finally sends the target bus card ID and the modified target bus card balance to the server, the method and the system enable the server to generate a new transaction key, and replace the current transaction key with the new transaction key when the bus card simulation terminal receives the new transaction key sent by the server, so that the processing of the target bus card is finally completed.

Drawings

Fig. 1 is a schematic diagram of a hardware structure of an implementation manner of a bus card processing device according to an embodiment of the present invention;

FIG. 2 is a schematic flow chart diagram of a first embodiment of a bus card processing method according to the present invention;

FIG. 3 is a flowchart illustrating a second embodiment of a method for processing a bus card according to the present invention;

FIG. 4 is a schematic flow chart diagram illustrating a bus card processing method according to a third embodiment of the present invention;

FIG. 5 is a functional block diagram of an embodiment of the bus card processing apparatus of the present invention;

FIG. 6 is a functional block diagram of another embodiment of the bus card processing apparatus of the present invention;

fig. 7 is a functional module schematic diagram of another embodiment of the bus card processing device of the invention.

The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.

Detailed Description

It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

In the following description, suffixes such as "module", "component", or "unit" used to denote elements are used only for facilitating the explanation of the present invention, and have no specific meaning in itself. Thus, "module", "component" or "unit" may be used mixedly.

The bus card processing terminal (also called terminal, equipment or terminal equipment) in the embodiment of the invention can be equipment with a bus card processing program compiling function such as a personal computer and the like, and can also be equipment with a bus card processing program running function such as a smart phone and a tablet personal computer and the like.

As shown in fig. 1, the terminal may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.

Optionally, the terminal may further include a camera, a Radio Frequency (RF) circuit, a sensor, an audio circuit, a WiFi module, and the like. Such as light sensors, motion sensors, and other sensors. In particular, the light sensor may comprise an ambient light sensor. Of course, the mobile terminal may also be configured with other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which are not described herein again.

Those skilled in the art will appreciate that the terminal structure shown in fig. 1 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.

As shown in fig. 1, a memory 1005, which is a readable storage medium, may include therein an operating system, a network communication module, a user interface module, and a bus card processing program.

In the terminal shown in fig. 1, the network interface 1004 is mainly used for connecting to a backend server and performing data communication with the backend server; the user interface 1003 is mainly used for connecting a client (user side) and performing data communication with the client; and the processor 1001 may be configured to call a bus card processing program stored in the memory 1005, and the bus card processing program, when executed by the processor, implements the operations in the bus card processing method provided by the following embodiments.

Based on the hardware structure of the equipment, the embodiment of the bus card processing method is provided.

Referring to fig. 2, in a first embodiment of the bus card processing method of the present invention, the bus card processing method includes:

and step S10, when a target bus card is detected, acquiring the ID and the balance of the target bus card corresponding to the target bus card, and sending a key acquisition request to a server corresponding to the target bus card.

The bus card processing method in the embodiment is applied to a bus card simulation terminal, wherein the bus card simulation terminal may be an intelligent wearable device (e.g., a smart band, a smart watch, and the like) or a smart phone, and the target bus card in the embodiment may be an entity bus card or an electronic bus card. When the bus card simulation terminal with the NFC function is turned on and the target bus card approaches, the bus card simulation terminal detects the target bus card, and obtains the ID (i.e. the ID of the target bus card in this embodiment) and the balance (i.e. the balance of the target bus card in this embodiment) of the target bus card by reading the target bus card, it can be known that one bus card has a unique identification number, and the electronic bus card generated by the smart bracelet or the smart phone has a unique identification number, which is the same as the physical bus card, and also has a unique different identification number, therefore, in the prior art, it is impossible to generate two bus cards with the same identification number by simulating an opened bus card, and after obtaining the ID of the target bus card and the balance of the target bus card in this application, the bus card processing program sends a key obtaining request to the server corresponding to the target bus card, and it can be known that the server in this embodiment is the server used by the bus company corresponding to the target bus card, the method has the effects that basic data (the ID and the balance of the bus card) of the bus card and a transaction key under the name of the bus company are stored, the basic data of the bus card generally does not need key verification, many devices with the NFC function can acquire the basic data of the bus card but cannot modify the basic data of the bus card, the transaction key is acquired by the transaction key needing key verification, the transaction key has the effects of modifying the balance of the bus card in the basic data of the bus card, different transaction keys are required for modifying the balance of the bus card every time, and the key acquiring request in the embodiment is used for acquiring the key, namely the key required for acquiring the transaction key.

Step S20, receiving a read key sent by the server based on the key acquisition request, and acquiring the current transaction key of the target bus card according to the read key, so as to generate a simulated bus card containing the ID of the target bus card, the balance of the target bus card and the current transaction key in the bus card simulation terminal.

Therefore, after the bus card simulation terminal obtains the ID of the target bus card, the balance of the target bus card and the current transaction key, a simulated bus card including the ID of the target bus card, the balance of the target bus card and the current transaction key can be generated in the bus card simulation terminal, and the copy of the target bus card and the transfer of the balance of the bus card are completed.

And step S30, when receiving a target transaction request based on the simulated bus card, acquiring a transaction amount corresponding to the target transaction request, and modifying the balance of the target bus card corresponding to the simulated bus card according to the read key and the transaction amount.

Destination bus card ID Destination bus card balance Transaction key Transaction time
05497182 80 PASDX03248 2020.12.01 15:32:14
05497182 78.5 PXZAW26741 2020.12.02 09:16:20
05497182 77 AJYTR45019

TABLE 1

It can be known that, when a transaction is performed by using a simulated bus card, a current transaction key needs to be obtained by using a read key, and the balance of the bus card is modified by using the current transaction key, as shown in table 1, the ID of the target bus card is 05497182, that is, the ID of the simulated bus card is 05497182, when a user swipes the card by using the simulated bus card, the bus card simulation terminal obtains basic data of the bus card corresponding to the simulated bus card (the ID of the bus card is 05497182, and the balance of the bus card is 80), further, the bus card simulation terminal sends a query request to a server to determine the current transaction key (PXZAW26741) corresponding to the bus card ID05497182, and when the bus card simulation terminal receives a target transaction request generated based on the simulated bus card (when swiping the card), the transaction amount of the transaction, that is the transaction amount corresponding to the target transaction request, is obtained first, and the current card swiping transaction is completed by using the current transaction key PXZAW26741, and (3) modifying the balance of the target bus card corresponding to the simulated bus card, namely modifying the balance of the bus card corresponding to the ID of the target bus card from 78.5 yuan to 77 yuan, and simultaneously recording the transaction time.

And step S40, sending the ID of the target bus card and the balance of the modified target bus card to the server so that the server generates a new transaction key, receiving the new transaction key sent by the server, and replacing the current transaction key with the new transaction key to complete the processing of the target bus card.

After the bus card simulation terminal obtains the current bus card balance corresponding to the bus card ID inquired at the server and the transaction amount, the target bus card ID and the modified target bus card balance are sent to the server so that the server generates a new transaction key (AJYTR 45019 in the above table), and after the bus card simulation terminal receives the new transaction key sent by the server, the current transaction key is replaced by the new transaction key in a storage space for storing the transaction key in the bus card simulation terminal, namely PXZAW26741 is replaced by the AJYTR45019 in the table 1, so that the bus card can be simulated to finish card swiping payment when the bus card is used next time.

Specifically, the step of step S10 refinement includes:

a1, when a target bus card is detected, inquiring a target non-encrypted storage block corresponding to the target bus card, and reading the ID of the target bus card and the balance of the target bus card in the target non-encrypted storage block;

step a2, inquiring a target encryption storage block corresponding to the target bus card, and sending a key acquisition request to a server corresponding to the target bus card.

The information related to the target bus card is divided into two types, one type is unencrypted basic information (including a target bus card ID and a target bus card balance) and the other type is encrypted transaction information (including a read key and a transaction key), the target unencrypted storage block and the target encrypted storage block in the embodiment can be areas for storing information in the target bus card and can also be areas for storing information in a server, the difference is that the target unencrypted storage block is externally disclosed, a bus card simulation terminal can obtain the target bus card ID and the target bus card balance stored in the target unencrypted storage block by scanning the target bus card, the target encrypted storage block is not externally disclosed, and when the bus card simulation terminal obtains the transaction information stored in the target encrypted storage block by scanning the target bus card, the bus card simulation terminal needs to firstly send a key obtaining request to the server corresponding to the target bus card, to receive the read key sent by the server.

Specifically, the step of step S20 refinement includes:

step b1, receiving the read key sent by the server, and reading the current transaction key in the target encrypted storage area block according to the read key.

Step b2, generating a simulated bus card containing the target bus card ID, the target bus card balance and the current transaction key, wherein the target bus card ID and the target bus card balance are stored in a simulated non-encrypted storage block corresponding to the simulated bus card, and the current transaction key is stored in a simulated encrypted storage block corresponding to the simulated bus card.

The bus card simulation terminal can generate a simulated bus card containing the ID of the target bus card, the balance of the target bus card and the current transaction key after obtaining the current transaction key stored in the target encryption storage block according to the read key after receiving the read key sent by the server, and the ID of the target bus card and the balance of the target bus card are stored in a simulated non-encryption storage block corresponding to the simulated bus card, the current transaction key is stored in a simulation encryption storage block corresponding to the simulation bus card, wherein the simulation non-encryption storage block and the simulation encryption storage block are storage areas used for storing a target bus card ID, a target bus card balance and the current transaction key in the bus card simulation terminal.

Specifically, the step S40 is detailed as follows:

and c1, receiving the new transaction key sent by the server, and storing the ID of the target bus card and the balance of the modified target bus card in the simulated non-encrypted storage block.

And c2, storing the new transaction key in the simulated encryption storage block to complete the processing of the target bus card.

When the transaction is completed based on the simulated bus card, the balance of the target bus card is modified, the server side generates a new transaction key and sends the new transaction key to the bus card simulation terminal, the bus card simulation terminal stores the ID of the target bus card and the modified balance of the target bus card in a simulated non-encrypted storage area in the bus card simulation terminal after receiving the new transaction key sent by the server, and stores the new transaction key in a simulated encrypted storage area in the bus card simulation terminal so as to complete the processing of the target bus card.

In this embodiment, when the bus card simulation terminal detects a target bus card, the bus card simulation terminal obtains a target bus card ID and a target bus card balance corresponding to the target bus card, sends a key obtaining request to a server corresponding to the target bus card, receives a key read by the server based on the key obtaining request, obtains a current transaction key corresponding to the target bus card through the key read, generates a simulated bus card containing the target bus card ID, the target bus card balance and the current transaction key in the bus card simulation terminal, obtains a transaction amount corresponding to the target transaction request when the bus card simulation terminal receives the target transaction request based on the simulated bus card, modifies the target bus card balance corresponding to the simulated bus card according to the key read and the transaction amount, and finally sends the target bus card ID and the modified target bus card balance to the server, the method and the system enable the server to generate a new transaction key, and replace the current transaction key with the new transaction key when the bus card simulation terminal receives the new transaction key sent by the server, so that the processing of the target bus card is finally completed.

Further, referring to fig. 3, in a second embodiment of the bus card processing method of the present invention, the bus card processing method includes:

and step S50, when the simulated bus card is detected, sending a target transaction request to the bus card simulation terminal corresponding to the simulated bus card, and receiving the target bus card ID, the target bus card balance and the current transaction key sent by the bus card simulation terminal based on the target transaction request.

And step S60, sending an inquiry request to a server corresponding to the simulated bus card based on the ID of the target bus card, and receiving a first bus card balance and a first transaction key sent by the server based on the inquiry request.

Step S70, if the current transaction key is not the same as the first transaction key, sending a verification request to the server based on the current transaction key, and receiving a verification result sent by the server based on the verification request.

And step S80, according to the verification result, carrying out transaction operation on the simulated bus card, acquiring the transaction amount corresponding to the transaction operation, and determining the balance of the second bus card according to the balance of the first bus card and the transaction amount.

And step S90, sending the second bus card balance to the bus card simulation terminal and the server, so that the bus card simulation terminal modifies the target bus card balance, and the server modifies the first bus card balance.

The bus card processing method in this embodiment is further applied to a bus card reader, when a user swipes a card by using a simulated bus card in a bus card simulation terminal, the bus card reader detects the simulated bus card and sends a target transaction request to the bus card simulation terminal, the bus card simulation terminal sends a target bus card ID, a target bus card balance and a current transaction key to the bus card reader after receiving the target transaction request sent by the bus card reader, the bus card reader sends an inquiry request to a server corresponding to the simulated bus card (i.e. the target bus card in the above embodiment) after receiving the target bus card ID, and receives a first bus card balance and a first transaction key sent by the server based on the target bus card ID, wherein the first bus card balance is the latest bus card balance corresponding to the target bus card ID stored in the server, the first transaction key is the latest transaction key corresponding to the target bus card ID stored in the server, as shown in table 1, after the bus card reader receives the current transaction key sent by the bus card simulation terminal and the first transaction key sent by the server, it will first be determined whether the current transaction key is the same as the first transaction key, if the current transaction key is different from the first transaction key, it indicates that the user has swiped the card using the target bus card before the bus card is swiped, so that the server updates the transaction key, but the bus card simulation terminal does not update the transaction key, in this case, the bus card reader will send the current transaction key to the server for verification, to determine whether the current transaction key is the transaction key used before the bus card corresponding to the target bus card ID, if the verification result sent by the server indicates that the current transaction key is the transaction key used before the bus card corresponding to the target bus card ID, and finally, the bus card reader sends the second bus card balance to the bus card simulation terminal and the server so that the bus card simulation terminal modifies the target bus card balance of the memory and the server modifies the first bus card balance.

In this embodiment, the difference from the existing bus card reader is that the existing bus card reader can directly deduct money from the bus card when detecting the bus card (simulated bus card or entity bus card), but the bus card reader of the present invention can query balance and transaction key and judge whether the current transaction key is the same as the first transaction key when detecting the simulated bus card, so that the (entity) target bus card can be commonly used while the simulated bus card can be used, and various (simulated bus card and entity bus card with the same ID) payment modes can be flexibly used on the basis of one card.

Further, referring to fig. 4, in a third embodiment of the bus card processing method of the present invention, the bus card processing method includes:

step S100, receiving an inquiry request sent by a bus card reader, and acquiring a target bus card ID corresponding to the inquiry request, and a first bus card balance and a first transaction key corresponding to the target bus card ID.

Step S110, sending the first bus card balance and the first transaction key to the bus card reader, receiving a verification request sent by the bus card reader, and obtaining a current transaction key corresponding to the verification request.

And step S120, inquiring preset transaction data, determining a verification result corresponding to the verification request according to the preset transaction data and the current transaction key, and sending the verification result to the bus card reader.

And step S130, when a second bus card balance sent by the bus card simulation terminal is received based on the verification result, generating a second transaction key, replacing the first bus card balance with the second bus card balance, and replacing the first transaction key with the second transaction key.

And step S140, sending the second transaction key to the bus card simulation terminal so that the bus card simulation terminal replaces the current transaction key with the second transaction key.

Destination bus card ID Destination bus card balance Transaction key Transaction time
05497182 80 PASDX03248 2020.12.01 15:32:14
05497182 78.5 PXZAW26741 2020.12.02 09:16:20
05497182 77 AJYTR45019 2020.12.04 17:20:14
05497182 75 KIYGT38124 2020.12.05 08:35:50
05497182 73.5 REWAB65102

TABLE 2

The bus card processing method in this embodiment is further applied to a server, when a user swipes a card by using a simulated bus card in a bus card simulation terminal, the bus card reader detects the simulated bus card and sends a target transaction request to the bus card simulation terminal, the bus card simulation terminal sends a target bus card ID, a target bus card balance and a current transaction key to the bus card reader after receiving the target transaction request sent by the bus card reader, the bus card reader sends an inquiry request to the server after receiving the target bus card ID, the server obtains the target bus card ID carried by the inquiry request and inquires a first bus card and a first transaction key corresponding to the target bus card ID in a storage space in the server after receiving the inquiry request sent by the bus card reader, wherein the first bus card balance is the latest bus card balance corresponding to the target bus card ID stored in the server, the first transaction key is a latest transaction key corresponding to a target bus card ID stored in the server, after the first bus card balance and the first transaction key are inquired, the server sends the first bus card balance and the first transaction key to a bus card reader and receives a verification request carrying a current transaction key sent by the bus card reader, the preset transaction data in the embodiment refers to a historical transaction key corresponding to the target bus card ID, if the transaction key in the table 2 is used, if the current transaction key is in the transaction keys, the verification result is verification pass, the server sends the verification result of the verification pass to the bus card reader, after the bus card reader receives the verification result of the verification pass sent by the server, the calculated second bus card balance is sent to the bus card simulation terminal so that the bus card simulation terminal can modify the target bus card balance of the memory, the bus card simulation terminal sends the balance of the second bus card to the server, the server generates a second transaction key when receiving the balance of the second bus card, replaces the balance of the first bus card with the balance of the second bus card, replaces the first transaction key with the second transaction key, and after the second transaction key is generated, the server also sends the second transaction key to the bus card simulation terminal so that the bus card simulation terminal can replace the current transaction key with the second transaction key to complete the processing of the target bus card.

Specifically, the step of step S120 refinement includes:

and d1, acquiring the balance of the target bus card corresponding to the current transaction key from the bus card simulation terminal, and acquiring the transaction key set in the preset transaction data.

And d2, taking the transaction key in the transaction key set, which is the same as the current transaction key, as a third transaction key, and obtaining a third bus card balance corresponding to the third transaction key from the preset transaction data.

And d3, if the balance of the target bus card is the same as that of the third bus card, determining that the verification result corresponding to the verification request is successful.

As shown in table 2, if the current transaction key stored in the analog encryption storage block corresponding to the analog bus card is AJYTR45019, and the balance of the target bus card corresponding to the current transaction key is 77, the transaction key set in this embodiment refers to the historical transaction key corresponding to the target bus card ID (05497182), and the preset transaction data in this embodiment may further include transaction time, the transaction key set in this embodiment includes paddx 03248, PXZAW26741, AJYTR45019, and KIYGT38124, and the historical transaction key that is the same as the current transaction key is AJYTR45019, that is, the third transaction key in this embodiment, it can be known from table 2 that the balance of the third bus card corresponding to the third transaction key is 77, and if the balance of the target bus card stored in the analog non-encryption storage block corresponding to the analog terminal of the bus card is also 77, the verification result corresponding to the verification request is determined to be successful verification.

In this embodiment, the difference from the existing server is that the existing server does not receive the inquiry request sent by the bus card reader, but only receives the deduction request sent by the bus card reader and modifies the balance corresponding to the target bus card ID, but the server in the present invention receives the inquiry request sent by the bus card reader, verifies the current transaction key corresponding to the inquiry request, and sends the latest transaction key to the bus card simulation terminal.

In addition, referring to fig. 5, an embodiment of the present invention further provides a bus card processing apparatus, where the bus card processing apparatus includes:

a key obtaining request sending module 10, configured to, when a target bus card is detected, obtain a target bus card ID and a target bus card balance corresponding to the target bus card, and send a key obtaining request to a server corresponding to the target bus card;

a current transaction key obtaining module 20, configured to receive a key reading request sent by the server based on the key obtaining request, and obtain a current transaction key of the target bus card according to the key reading request, so as to generate, in the bus card simulation terminal, a simulated bus card including the ID of the target bus card, the balance of the target bus card, and the current transaction key;

the balance modification module 30 is configured to, when a target transaction request is received based on the simulated bus card, obtain a transaction amount corresponding to the target transaction request, and modify a balance of the target bus card corresponding to the simulated bus card according to the read key and the transaction amount;

and the transaction key modification module 40 is configured to send the target bus card ID and the modified balance of the target bus card to the server, so that the server generates a new transaction key, receives the new transaction key sent by the server, and replaces the current transaction key with the new transaction key to complete processing of the target bus card.

Optionally, the key obtaining request sending module 10 includes:

the first reading unit is used for inquiring a target non-encrypted storage block corresponding to a target bus card when the target bus card is detected, and reading the ID of the target bus card and the balance of the target bus card in the target non-encrypted storage block;

and the key acquisition request sending unit is used for inquiring a target encryption storage block corresponding to the target bus card and sending a key acquisition request to a server corresponding to the target bus card.

Optionally, the current transaction key obtaining module 20 includes:

the second reading unit is used for receiving the reading key sent by the server and reading the current transaction key in the target encryption storage area block according to the reading key;

and the simulated bus card generating unit is used for generating a simulated bus card containing the target bus card ID, the target bus card balance and the current transaction key, wherein the target bus card ID and the target bus card balance are stored in a simulated non-encrypted storage block corresponding to the simulated bus card, and the current transaction key is stored in a simulated encrypted storage block corresponding to the simulated bus card.

Optionally, the transaction key modification module 40 includes:

the new transaction key sending unit is used for receiving the new transaction key sent by the server and storing the ID of the target bus card and the balance of the modified target bus card in the simulated non-encrypted storage block;

and the storage unit is used for storing the new transaction key in the analog encryption storage block to finish the processing of the target bus card.

In addition, referring to fig. 6, an embodiment of the present invention further provides another bus card processing apparatus, where the bus card processing apparatus is disposed in a bus card reader, and the bus card processing apparatus includes:

the target transaction request sending module 50 is configured to send a target transaction request to a bus card simulation terminal corresponding to the simulated bus card when the simulated bus card is detected, and receive a target bus card ID, a target bus card balance and a current transaction key sent by the bus card simulation terminal based on the target transaction request;

the inquiry request sending module 60 is configured to send an inquiry request to a server corresponding to the simulated bus card based on the ID of the target bus card, and receive a first bus card balance and a first transaction key sent by the server based on the inquiry request;

an authentication request sending module 70, configured to send an authentication request to the server based on the current transaction key if the current transaction key is different from the first transaction key, and receive an authentication result sent by the server based on the authentication request;

the second bus card balance determining module 80 is configured to perform a transaction operation on the simulated bus card according to the verification result, obtain a transaction amount corresponding to the transaction operation, and determine a second bus card balance according to the first bus card balance and the transaction amount;

and a second bus card balance sending module 90, configured to send the second bus card balance to the bus card simulation terminal and the server, so that the bus card simulation terminal modifies the target bus card balance, and the server modifies the first bus card balance.

In addition, referring to fig. 7, an embodiment of the present invention further provides another bus card processing apparatus, where the bus card processing apparatus is disposed in a server, and the bus card processing apparatus includes:

the system comprises an inquiry request receiving module 100, a first transaction key obtaining module and a second transaction key obtaining module, wherein the inquiry request receiving module is used for receiving an inquiry request sent by a bus card reader, and obtaining a target bus card ID corresponding to the inquiry request, and a first bus card balance and a first transaction key corresponding to the target bus card ID;

a current transaction key obtaining module 110, configured to send the first bus card balance and the first transaction key to the bus card reader, receive an authentication request sent by the bus card reader, and obtain a current transaction key corresponding to the authentication request;

the transaction data query module 120 is configured to query preset transaction data, determine a verification result corresponding to the verification request according to the preset transaction data and the current transaction key, and send the verification result to the bus card reader;

a second transaction key generation module 130, configured to generate a second transaction key when a second bus card balance sent by the bus card simulation terminal is received based on the verification result, replace the first bus card balance with the second bus card balance, and replace the first transaction key with the second transaction key;

and a second transaction key sending module 140, configured to send the second transaction key to the bus card simulation terminal, so that the bus card simulation terminal replaces the current transaction key with the second transaction key.

Optionally, the transaction data query module includes:

a transaction key set acquisition unit, configured to acquire a balance of the target bus card corresponding to the current transaction key from the bus card simulation terminal, and acquire a transaction key set in the preset transaction data;

the third bus card balance obtaining unit is used for taking a transaction key in the transaction key set, which is the same as the current transaction key, as a third transaction key and obtaining a third bus card balance corresponding to the third transaction key from the preset transaction data;

and the verification result determining unit is used for determining that the verification result corresponding to the verification request is successful if the balance of the target bus card is the same as that of the third bus card.

In addition, an embodiment of the present invention further provides a readable storage medium, where a bus card processing program is stored on the readable storage medium, and when the bus card processing program is executed by a processor, the bus card processing program implements the operations in the bus card processing method provided in the foregoing embodiment.

The method executed by each program module can refer to each embodiment of the method of the present invention, and is not described herein again.

It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity/action/object from another entity/action/object without necessarily requiring or implying any actual such relationship or order between such entities/actions/objects; the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.

For the apparatus embodiment, since it is substantially similar to the method embodiment, it is described relatively simply, and reference may be made to some descriptions of the method embodiment for relevant points. The above-described apparatus embodiments are merely illustrative, in that elements described as separate components may or may not be physically separate. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the invention. One of ordinary skill in the art can understand and implement it without inventive effort.

The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.

Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be substantially or partially embodied in the form of a software product, where the computer software product is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above, and includes several instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the bus card processing method according to the embodiments of the present invention.

The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

20页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种智能卡动态密码认证方法及系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!