A method and apparatus for processing transaction data fusion of transportation cards

By integrating card code transaction data processing methods through near-field communication between mobile payment terminals and transaction terminals, the network dependence and fraud risks of QR code payments for transportation have been solved, enabling secure and efficient transactions in offline environments.

CN123118093APending Publication Date: 2026-11-17BEIJING CCCC GOLD CARD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611372558.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-06
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

Existing QR code payment for transportation has problems such as strong reliance on the network, low efficiency, and the risk of fraudulent transactions. In particular, it is difficult to guarantee the security and efficiency of transactions in environments without a network.

Method used

By implementing near-field communication between mobile payment terminals and transaction terminals, a card-code transaction data processing method is integrated, including acquiring electronic ticket data, generating card-code fusion data, and performing offline verification of signature and transaction voucher data, to ensure the security and efficiency of transactions.

Benefits of technology

It ensures the reliability and security of transactions in offline environments, improves traffic efficiency, prevents the risk of fraudulent transactions, and simplifies user operation processes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123118093A_ABST
    Figure CN123118093A_ABST
Patent Text Reader

Abstract

This invention provides a method and apparatus for processing card-code fusion transaction data for transportation cards, solving the problems of network dependence, low passage efficiency, and the risk of fraudulent use in transportation QR code payments. The method includes: acquiring electronic ticket data from a mobile payment terminal, the electronic ticket data including a target application identifier, ticket type identifier, and algorithm identifier; determining card-code fusion data based on the electronic ticket data; acquiring a card-code fusion electronic ticket transaction instruction sent by a transaction terminal via near-field communication; determining electronic ticket response data based on the card-code fusion electronic ticket transaction instruction; sending the electronic ticket response data to the transaction terminal via near-field communication and interacting with the transaction terminal to determine signature data and transaction voucher data; sending the card-code fusion data, signature data, and transaction voucher data to the transaction terminal and receiving transaction result data returned by the transaction terminal. This solution improves the security and efficiency of card swiping and expands application scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of traffic information processing technology, and in particular to a method and apparatus for processing transaction data fusion of traffic cards. Background Technology

[0002] Urban public transportation payment has evolved from physical tickets and contact IC cards to contactless CPU cards. In recent years, with the widespread adoption of smartphones, QR code-based mobile payments have been rapidly promoted due to their cross-regional interoperability, coexisting with virtual card payments based on Near Field Communication (NFC). However, these two mainstream technologies are independent in data processing and transaction implementation, each with significant limitations. While QR code payments are easy to promote, their transaction process is highly dependent on mobile networks, and loading failures are prone to occur in weak signal scenarios such as underground areas, leading to traffic congestion. The operation requires multiple steps, including waking up the phone, retrieving the QR code, and aligning it for recognition, making it less efficient than the "one-tap-and-pass" method of NFC. In terms of security, dynamic QR codes are susceptible to being screenshotted and used fraudulently, and their verification relies entirely on online risk control; a lost phone could lead to account theft. Furthermore, QR code transactions lack reliable offline credentials in offline environments, making it difficult for clearing and settlement systems to effectively handle transaction disputes, posing reconciliation and financial risks to operators. Summary of the Invention

[0003] This invention provides a method and apparatus for processing transaction data by integrating the card code of a transportation card, which solves the problems of network dependence, low passage efficiency and the risk of fraudulent use in transportation QR code payments.

[0004] To solve the above-mentioned technical problems, the technical solution of the present invention is as follows: This invention provides a method for processing transaction data of a transportation card using a fusion code, applied to a near-field communication mobile payment terminal, comprising: Obtain electronic ticket data from the mobile payment terminal, wherein the electronic ticket data includes the target application identifier, ticket type identifier, and algorithm identifier; Based on the electronic ticket data, determine the card code fusion data; Obtain the card-code fusion electronic ticket transaction instructions sent by the transaction terminal via near-field communication; Based on the card-code fusion electronic ticket transaction instruction, determine the electronic ticket response data; The electronic ticket response data is sent to the transaction terminal via near-field communication, and the transaction terminal is interacted with to determine the signature data and transaction voucher data. The card code fusion data, signature data, and transaction certificate data are sent to the transaction terminal, and the transaction result data returned by the transaction terminal is received. The transaction result data is obtained by the transaction terminal through offline verification processing of the card code fusion data, signature data, and transaction certificate data.

[0005] Optionally, based on the electronic ticket data, the card code fusion data is determined, including: The electronic ticket data of the application is sent to the cloud server, and the personalized data, partial code data and pre-authorization certificate data generated by the cloud server based on the electronic ticket data are received. Obtain the user's private key data from the mobile payment terminal; Based on the user's private key data, the electronic ticket data and code data are fused to obtain card-code fused data.

[0006] Optionally, based on the card-code fusion electronic ticket transaction instruction, the electronic ticket response data is determined, including: Based on the card-code fusion electronic ticket transaction instruction, the target application identifier, ticket type identifier, and algorithm identifier are integrated and processed to obtain electronic ticket response data.

[0007] Optionally, the electronic ticket response data is sent to the transaction terminal via near-field communication, and commands are exchanged with the transaction terminal to determine signature data and transaction voucher data, including: The system receives a transaction initialization command sent by the transaction terminal, which is obtained by the transaction terminal parsing and processing the response data of the electronic ticket card. The transaction initialization instruction is parsed and processed to obtain the transaction time and random number; Receive balance check instructions sent by the transaction terminal; According to the balance detection instruction, obtain the balance file data pre-stored in the mobile payment terminal file system; The balance file data is sent to the transaction terminal, and a transaction control instruction is received. The transaction control instruction is obtained by the transaction terminal through judgment and processing of the balance file data. According to the transaction control instruction, the transaction time and the random number are combined and processed to obtain signature data and transaction voucher data.

[0008] Optionally, according to the transaction control instruction, the transaction time and the random number are combined and processed to obtain signature data and transaction voucher data, including: The transaction control instruction is parsed and processed to obtain the balance status identifier; When the balance status is identified as a first preset value, the following formula is used: Sig1=SM2_Sign[ sk , C ∥ T ∥ R ], Generate signature data for scenarios with a balance, where Sig1 is the signature data for scenarios with a balance; sk This represents the user's private key data; ∥ represents the string concatenation operation. T For trading hours; R It is a random number; C For card code fusion data; SM2_Sign( ) is the signature function; according to: TC1=MAC8(SM 4Encrypt (DeriveKey(acKeymaster, ATC), Padding( B ∥Ver enc ),Sig1)), Generate transaction voucher data, where TC1 is the transaction voucher data for scenarios with a balance; ATC is the application transaction counter; acKeymaster is the master key for the application ciphertext; Ver enc Data elements generated for ciphertext version 18; SM 4Encrypt ( ) is the national standard SM4 encryption function; MAC8 ( The function `padding(` outputs an 8-byte message authentication code) is used to output the authentication code. ) is the fill function; DeriveKey( ) is the key derivation function; When the balance status is identified as the second preset value, then the formula is used: Sig0=SM2_Sign[ sk , C ∥ T ∥ R ∥ Auth ], Generate signature data for a no-balance scenario, where Sig0 is the signature data for a no-balance scenario; Auth This is pre-authorization credential data; according to: TC0=MAC8(SM 4Encrypt (DeriveKey(acKeymaster, ATC), Padding Auth ∥Ver enc ), Sig0)), Generate transaction voucher data for a no-balance scenario, where TC0 is the transaction voucher data for a no-balance scenario.

[0009] This invention also provides a method for processing card-code fusion transaction data of a transportation card, applied to a near-field communication transaction terminal, including: Generate card code fusion electronic ticket transaction instructions; The card-code fused electronic ticket transaction instruction is sent to the mobile payment terminal, and the electronic ticket response data returned by the mobile payment terminal is received. The electronic ticket response data is parsed and processed to obtain the transaction initialization command; Generate balance check instruction; The transaction initialization command and balance detection command are sent to the mobile payment terminal, and the balance file data returned by the mobile payment terminal is received. The balance file data is processed to obtain transaction control instructions; The transaction control instruction is sent to the mobile payment terminal, and the card code fusion data, signature data, and transaction certificate data returned by the mobile payment terminal are received. The card code fusion data, signature data, and transaction credential data are verified to obtain transaction result data. The transaction result data is sent to the mobile payment terminal.

[0010] Optionally, the electronic ticket response data is parsed to obtain a transaction initialization instruction, including: The electronic ticket response data is identified and processed to obtain a list of ticket type identifiers, algorithm identifiers, and processing option data objects; Based on the list of processing option data objects, determine the transaction attribute data of the transaction terminal; The ticket type identifier, algorithm identifier, and transaction attributes are combined and processed to obtain the transaction initialization instruction.

[0011] Optionally, the card code fusion data, signature data, and transaction credential data are verified to obtain transaction data, including: Retrieve the verification public key data stored in the transaction terminal; Based on the verification data and the signature data, the card code fusion data is processed by signature verification to obtain signature verification result data; The transaction data is determined based on the verification result data and the transaction voucher data.

[0012] This invention also provides a card-code fusion transaction data processing device for transportation cards, applied to near-field communication mobile payment terminals, comprising: The acquisition module is used to acquire electronic ticket data from the mobile payment terminal. The electronic ticket data includes the target application identifier, ticket type identifier, and algorithm identifier. The determining module is used to determine the card code fusion data based on the electronic ticket data; The acquisition module is also used to acquire the card-code fusion electronic ticket transaction instructions sent by the transaction terminal via near-field communication. The determining module is also used to determine the electronic ticket response data based on the card code fusion electronic ticket transaction instruction; The first transceiver module is used to send the electronic ticket response data to the transaction terminal via near-field communication, and to interact with the transaction terminal to determine the signature data and transaction voucher data; to send the card code fusion data, signature data and transaction voucher data to the transaction terminal, and to receive the transaction result data returned by the transaction terminal, wherein the transaction result data is obtained by the transaction terminal through offline verification processing of the card code fusion data, signature data and transaction voucher data.

[0013] This invention also provides a card-code fusion transaction data processing device for transportation cards, applied to near-field communication transaction terminals, comprising: The generation module is used to generate electronic ticket transaction instructions that integrate card and code. The second transceiver module is used to send the card-code integrated electronic ticket transaction instruction to the mobile payment terminal and receive the electronic ticket response data returned by the mobile payment terminal. The processing module is used to parse and process the electronic ticket response data to obtain the transaction initialization instruction; The generation module is also used to generate balance detection instructions; The second transceiver module is also used to send the transaction initialization instruction and balance detection instruction to the mobile payment terminal, and to receive the balance file data returned by the mobile payment terminal; The processing module is also used to perform judgment processing on the balance file data to obtain transaction control instructions; The second transceiver module is also used to send the transaction control instruction to the mobile payment terminal, and to receive the card code fusion data, signature data and transaction certificate data returned by the mobile payment terminal; The processing module is also used to verify the card code fusion data, signature data and transaction certificate data to obtain transaction result data; The second transceiver module is also used to send the transaction result data to the mobile payment terminal.

[0014] The technical solution of the present invention has at least the following effects: The above-described solution of the present invention improves the security and efficiency of card swiping by acquiring electronic ticket data from a mobile payment terminal, wherein the electronic ticket data includes a target application identifier, a ticket type identifier, and an algorithm identifier; determining card-code fusion data based on the electronic ticket data; acquiring a card-code fusion electronic ticket transaction instruction sent by a transaction terminal via near-field communication; determining electronic ticket response data based on the card-code fusion electronic ticket transaction instruction; sending the electronic ticket response data to the transaction terminal via near-field communication and interacting with the transaction terminal to determine signature data and transaction voucher data; sending the card-code fusion data, signature data, and transaction voucher data to the transaction terminal and receiving transaction result data returned by the transaction terminal. Attached Figure Description

[0015] Figure 1 This is a flowchart of a method for processing transaction data of a transportation card fusion system applied to a near-field communication mobile payment terminal, provided by an embodiment of the present invention. Figure 2 This is a flowchart of a method for processing transaction data of a transportation card fusion system applied to a near-field communication transaction terminal, provided by an embodiment of the present invention. Figure 3 This is a mobile payment terminal application file structure diagram of the transaction terminal's card code fusion transaction data processing method provided in this embodiment of the invention; Figure 4 This is a flowchart of the pre-deduction transaction process of the card code fusion transaction data processing method for the transportation card of the transaction terminal provided in this embodiment of the invention; Figure 5 This is a flowchart of the post-deduction transaction process of the card code fusion transaction data processing method for the transportation card of the transaction terminal provided in this embodiment of the invention; Figure 6 This is a structural diagram of the card-code fusion transaction data processing device for transportation cards applied to near-field communication mobile payment terminals provided in this embodiment of the invention; Figure 7 This is a structural diagram of a card-code fusion transaction data processing device for a transportation card applied to a near-field communication transaction terminal, provided in an embodiment of the present invention. Detailed Implementation

[0016] Exemplary embodiments of the invention will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this invention will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.

[0017] like Figure 1As shown, an embodiment of the present invention proposes a method for processing transaction data of a transportation card fusion transaction, applied to a near-field communication mobile payment terminal, including: Step 11: Obtain electronic ticket data from the mobile payment terminal. The electronic ticket data includes the target application identifier, ticket type identifier, and algorithm identifier. Step 12: Determine the card code fusion data based on the electronic ticket data; Step 13: Obtain the card-code fusion electronic ticket transaction instruction sent by the transaction terminal via near-field communication; Step 14: Determine the electronic ticket response data based on the card-code fusion electronic ticket transaction instruction; Step 15: Send the electronic ticket response data to the transaction terminal via near-field communication, and interact with the transaction terminal to determine the signature data and transaction voucher data; Step 16: Send the card code fusion data, signature data, and transaction certificate data to the transaction terminal, and receive the transaction result data returned by the transaction terminal. The transaction result data is obtained by the transaction terminal through offline verification processing of the card code fusion data, signature data, and transaction certificate data.

[0018] In step 11 of this embodiment, the mobile payment terminal retrieves pre-configured, personalized electronic ticket data from its internal secure storage area. This data, distributed and written by the cloud server during the application initialization phase, constitutes the core identity and capability identifiers of the card-code fusion application. Specifically, the target application identifier is a 16-byte globally unique application identifier (AID), serving as the logical entry point for the electronic ticket in near-field communication transactions. The ticket type identifier clarifies the city / region, transportation industry, and applicable fare rules to which this electronic ticket belongs. The algorithm identifier mandates the use of a national cryptographic asymmetric encryption algorithm, such as the SM2 algorithm, in all subsequent transaction processes to ensure transaction security complies with national standards. These identifiers collectively define the business attributes and security baseline of this card-code fusion transaction.

[0019] In step 12, the mobile payment terminal determines the card-code fusion data through internal processing based on the acquired electronic ticket data. The card-code fusion data is a data structure that integrates the traditional transportation card simulation function with the dynamic code payment features, aiming to be compatible with card mode and code mode transactions in near-field communication. Specifically, the card-code fusion data includes a dynamic identifier generated based on the electronic ticket data, and a verification code for rapid verification. For example, the mobile payment terminal can combine the target application identifier, ticket type identifier, and algorithm identifier, and apply the algorithm specified by the algorithm identifier to generate a fusion data block. This data block contains both card sequence information and code generation parameters. This process ensures that the data can be recognized as a physical card simulation signal by the transaction terminal during transmission, while also supporting the offline verification requirements of the QR code.

[0020] In step 13, the mobile payment terminal, through its integrated near-field communication antenna and RF front-end module, listens in real time and acquires the card-code fusion electronic ticket transaction instructions from the transaction terminal. When the user brings the mobile payment terminal device close to a transaction terminal such as a bus gate or vehicle reader, the transaction terminal activates the RF field and sends this initialization instruction. This instruction is an APDU command conforming to the ISO / IEC 7816-4 standard, whose instruction header is usually set to the SELECT command code, and whose data field contains an AID value that matches the target application identifier. The NFC controller and protocol stack of the mobile payment terminal are responsible for demodulating, decoding, and verifying the RF signal, converting the physical layer signal into a structured instruction data object that can be processed by the upper-layer application. This step marks the formal initiation of a specific transaction session, and the mobile payment terminal thus enters the instruction response and data processing state.

[0021] In step 14, the mobile payment terminal parses the parameters in the received card-code fused electronic ticket transaction instruction and determines the electronic ticket response data based on the electronic ticket data. The electronic ticket response data is the mobile payment terminal's initial response to the transaction instruction, used to confirm the feasibility of the transaction and convey the basic status. For example, the mobile payment terminal will check the balance or validity period corresponding to the ticket type identifier. If the status is normal, it will generate response data containing a confirmation signal and an algorithm identifier. If the algorithm identifier specifies a specific encryption method, the response data may also include an encrypted temporary key or session identifier. This step ensures that the transaction terminal can initially verify the legitimacy of the mobile payment terminal.

[0022] In step 15, the mobile payment terminal sends the electronic ticket response data back to the transaction terminal via near-field communication, and then conducts multiple rounds of instruction interaction with the transaction terminal to determine the signature data and transaction voucher data; the instruction interaction process follows the near-field communication protocol.

[0023] In step 16, the mobile payment terminal sends the final processed transaction data packet to the transaction terminal. This data packet is a structured collection, with three core parts: card-code fusion data, which is a complete set of interoperable transportation codes read from the local file system; signature data, which is a digital signature generated by performing SM2 algorithm operations on the aforementioned code data set using the user's private key; and transaction credential data, which is a transaction certificate (TC) generated based on the context of this transaction. The mobile payment terminal sends this data packet in APDU response format via a near-field communication link. Subsequently, the transaction terminal independently performs offline verification processing locally, including verifying the validity of the signature using the corresponding public key and checking the legitimacy of the TC. After verification, the transaction terminal generates a final status code as transaction result data and returns it to the mobile payment terminal via NFC communication. The mobile payment terminal receives this result data and updates the user interface display according to its value, thus completing a complete transaction loop that integrates card interaction and code data verification.

[0024] The technical solution described in this embodiment utilizes a pre-built near-field communication (NFC) interoperability code dataset and signature verification mechanism on the mobile payment terminal. This allows critical transaction data to be processed and verified offline or in weak network environments, eliminating the need for real-time connection to a backend server for QR code generation and verification during transactions. This ensures payment reliability in signal-free scenarios such as subway turnstiles and tunnels. Simultaneously, NFC automatically triggers transactions and quickly retrieves the required local data based on application data location information, eliminating the need for users to manually open applications and refresh QR codes. This significantly shortens the interaction time between the transaction terminal and the mobile payment terminal, thereby improving turnstile passage speed. Addressing the risk of fraudulent transactions, a dynamically generated NFC interoperability code dataset is combined with transaction voucher data for digital signature, ensuring the uniqueness and non-copyability of each transaction. The transaction terminal must rigorously verify the signature and interoperability code, effectively preventing transaction instructions from being intercepted, replayed, or forged. This fundamentally curbs the risk of fraudulent transactions and enhances payment security. Furthermore, this method does not require separate authorization from the mobile terminal and is not subject to mobile terminal permission restrictions, expanding its application scenarios.

[0025] In an optional embodiment of the present invention, step 12, determining the card code fusion data based on the electronic ticket data, may include: Step 121: Send the electronic ticket data to the cloud server, and receive the code data and pre-authorization voucher data generated by the cloud server based on the electronic ticket data; Step 122: Obtain the user's private key data from the mobile payment terminal; Step 123: Based on the user private key data, the electronic ticket data and code data are fused to obtain card-code fused data.

[0026] In step 121 of this embodiment, the mobile payment terminal sends the requested electronic ticket data information to the cloud server via network communication. Upon receiving this data, the cloud server first verifies its legality, and then generates a complete code data set and electronic ticket data conforming to the interoperability technology standard for transportation smart cards, based on the requested ticket type, algorithm, and other information, and industry specifications. This electronic ticket data includes at least a target application identifier (AID), a ticket type identifier, and an algorithm identifier, which uniquely identify the user account and its business attributes. The code data set contains structured fields such as city code, industry code, application serial number, and effective date. Simultaneously, based on the request and the user's credit status, the cloud server generates a pre-authorization credential data. This credential is essentially a time-sensitive digital token signed by the server's private key, used to pre-approve transactions within a certain limit. Finally, the cloud server encrypts the generated code data set and the pre-authorization credential data together and sends them to the mobile payment terminal through a secure channel.

[0027] In step 122, the mobile payment terminal obtains the user's private key data from its internal secure element or trusted execution environment. This private key data is generated during the personalization initialization phase of the electronic ticketing application. The acquisition process does not involve reading plaintext; instead, it accesses a reference or handle to the private key within the mobile payment terminal's file environment by calling a standard application programming interface (API). This ensures that private key operations are performed within a physically isolated environment, and the content of the private key itself is never exposed, thereby guaranteeing its confidentiality and non-exportability.

[0028] In step 123, the standard format code data set received from the cloud server is first logically concatenated and formatted with the static identity information in the local electronic ticket data to form an expanded complete data block. This process essentially binds the universal interoperability code data with the user's specific application identity. Subsequently, the mobile payment terminal uses the obtained user private key data to perform a digital signature operation on the reconstructed complete data block. Specifically, the national cryptographic SM2 elliptic curve signature algorithm specified in the technical document is used to generate the corresponding digital signature. Finally, the mobile payment terminal associates and encapsulates the reconstructed complete data block with the digital signature to jointly constitute the card-code fusion data. This fusion data not only contains interoperable transportation credential information recognizable by standard terminals, but also, through cryptographic signature, inseparably binds the credential to the specific user device and private key, realizing the secure carrying and expression of the code data in the form of a card.

[0029] In an optional embodiment of the present invention, step 14, determining the electronic ticket response data according to the card-code fusion electronic ticket transaction instruction, may include: Step 141: Based on the card-code fusion electronic ticket transaction instruction, integrate the target application identifier, ticket type identifier, and algorithm identifier to obtain electronic ticket response data.

[0030] In step 141 of this embodiment, the mobile payment terminal initiates an integration processing flow to generate electronic ticket response data based on the received card-code fusion electronic ticket transaction instruction. The instruction processing module of the mobile payment terminal first parses the instruction data field and extracts the target application identifier (AID). Subsequently, the module uses this AID as an index to retrieve the corresponding ticket type identifier from a locally preset parameter table. Algorithm Identifier The core of the integrated processing lies in the structured encapsulation of these discrete identifiers according to the standard format of smart card file control information.

[0031] In an optional embodiment of the present invention, step 15, sending the electronic ticket response data to the transaction terminal via near-field communication and interacting with the transaction terminal to determine signature data and transaction voucher data, may include: Step 151: Receive a transaction initialization instruction sent by the transaction terminal. The transaction initialization instruction is obtained by the transaction terminal through parsing and processing the response data of the electronic ticket card. Step 152: Parse the transaction initialization instruction to obtain the transaction time and random number; Step 153: Receive the balance check instruction sent by the transaction terminal; Step 154: According to the balance detection instruction, obtain the balance file data pre-stored in the mobile payment terminal file system; Step 155: Send the balance file data to the transaction terminal and receive a transaction control instruction, wherein the transaction control instruction is obtained by the transaction terminal through judgment and processing of the balance file data; Step 156: According to the transaction control instruction, perform a combination operation on the transaction time and the random number to obtain signature data and transaction voucher data.

[0032] In step 151 of this embodiment, the mobile payment terminal receives a transaction initialization command sent by the transaction terminal through the established near-field communication link. Technically, this command is a Get Processing Options (GPO) command. Its generation logic is that the transaction terminal successfully parses the electronic ticket response data (FCI) previously returned by the mobile payment terminal, and according to the format requirements of the Processing Options Data Object List (PDOL) carried in the FCI, fills the command data field with key parameters such as the locally generated transaction time and terminal random number. The mobile payment terminal's communication protocol stack receives this complete APDU command byte stream and delivers it to the application processing module.

[0033] In step 152, the application processing module of the mobile payment terminal performs parsing processing on the received GPO instruction. The module first verifies the integrity of the instruction structure, and then decodes the instruction data field according to the tag order and data format defined by PDOL. Specifically, the module extracts the data object with tag value 9A, whose byte sequence represents the current transaction date and time collected by the transaction terminal, and decodes it to obtain the transaction time T. Simultaneously, the module extracts the data object with tag value 9F37, whose byte sequence is a cryptographic random number generated by the transaction terminal, and decodes it to obtain the random number Rnd. The parsing process can be formalized as a mapping function: (T, Rnd) = ParseGPO(Data_GPO, PDOL_Structure), Where Data_GPO is the GPO instruction data field, PDOL_Structure is the known PDOL structure definition, and ParseGPO is the function that parses and extracts the corresponding tag value based on the structure definition.

[0034] In step 153, before proceeding with subsequent calculations, the mobile payment terminal receives a balance check instruction from the transaction terminal. This is a read record instruction or data retrieval instruction conforming to the ISO / IEC 7816-4 standard, and its parameter bytes explicitly indicate that the requested file type is an e-wallet balance file. Receiving this instruction indicates that the transaction terminal is executing a pre-deduction process and needs to confirm the account's payment capacity before authorizing the transaction.

[0035] In step 154, the mobile payment terminal responds to the balance detection command and accesses its internal simulated smart card file system. Based on the short file identifier specified in the command, the system locates the dedicated basic file storing the balance and reads the specified record according to the command parameters.

[0036] In step 155 of this embodiment, the mobile payment terminal returns the balance information it retrieves from the file system to the transaction terminal. The transaction terminal performs core logic judgment based on the received response to determine the subsequent process. The core basis for the judgment is whether the balance file exists, which directly corresponds to two different transaction modes. If a valid balance value is received, it is determined that the mobile payment terminal supports the pre-deduction mode. The terminal further compares the balance value with a preset minimum transaction amount threshold. If the balance value is greater than the minimum transaction amount threshold, an instruction is generated to allow the pre-deduction transaction to continue; if the balance value is less than the minimum transaction amount threshold, an instruction is generated indicating insufficient balance and termination of the transaction, and it is determined that the mobile payment terminal supports the post-deduction (credit) mode. If a specific status code indicating that the balance file does not exist is received (e.g., file not found error), it is determined that the mobile payment terminal supports the post-deduction (credit) mode.

[0037] In step 156, the transaction control instruction is first parsed to obtain the balance status identifier, which is used to indicate the current transaction mode (post-deduction mode or pre-deduction mode). When the balance status is identified as the first preset value, i.e., there is a balance (a balance file exists), it is in pre-deduction mode, as indicated by the formula: Sig1=SM2_Sign[ sk , C ∥ T ∥ R ], Generate signature data for scenarios with a balance, where Sig1 is the signature data for scenarios with a balance; sk This represents the user's private key data; ∥ represents the string concatenation operation. T For trading hours; R It is a random number; C For card code fusion data; SM2_Sign( ) is the signature function; according to: TC1=MAC8(SM 4Encrypt (DeriveKey(acKeymaster, ATC), Padding( B ∥Ver enc ),Sig1)), Generate transaction voucher data, where TC1 is the transaction voucher data for scenarios with a balance; ATC is the application transaction counter; acKeymaster is the master key for the application ciphertext; Ver enc Data elements generated for ciphertext version 18; SM 4Encrypt ( ) is the national standard SM4 encryption function; MAC8 ( The function `padding(` outputs an 8-byte message authentication code) is used to output the authentication code. ) is the fill function; DeriveKey( ) is the key derivation function; When the balance status is identified as the second preset value, i.e., no balance (no balance file exists), then the formula is used: Sig0=SM2_Sign[ sk , C ∥ T ∥ R ∥ Auth ], Generate signature data for a no-balance scenario, where Sig0 is the signature data for a no-balance scenario; Auth This is pre-authorization credential data; according to: TC0=MAC8(SM 4Encrypt (DeriveKey(acKeymaster, ATC), Padding Auth ∥Ver enc ), Sig0)), Generate transaction voucher data for a no-balance scenario, where TC0 is the transaction voucher data for a no-balance scenario.

[0038] like Figure 2 As shown, an embodiment of the present invention proposes a method for processing card-code fusion transaction data of a transportation card, applied to a near-field communication transaction terminal, including: Step 21: Generate card-code fusion electronic ticket transaction instructions; Step 22: Send the card-code integrated electronic ticket transaction instruction to the mobile payment terminal and receive the electronic ticket response data returned by the mobile payment terminal; Step 23: Parse and process the electronic ticket response data to obtain the transaction initialization command; Step 24: Generate a balance check instruction; Step 25: Send the transaction initialization instruction and balance detection instruction to the mobile payment terminal, and receive the balance file data returned by the mobile payment terminal; Step 26: Process the balance file data to obtain transaction control instructions; Step 27: Send the transaction control instruction to the mobile payment terminal and receive the card code fusion data, signature data and transaction voucher data returned by the mobile payment terminal; Step 28: Verify the card code fusion data, signature data, and transaction voucher data to obtain transaction result data; Step 29: Send the transaction result data to the mobile payment terminal.

[0039] In step 21 of this embodiment, the near-field communication transaction terminal generates a card-code integrated electronic ticket transaction instruction based on its internally embedded transportation payment application logic. Technically, this instruction is an application selection instruction, specifically a SELECT command APDU instruction conforming to the ISO / IEC 7816-4 standard. The transaction terminal's processor sets the instruction category byte CLA, instruction code byte INS, and parameter bytes P1P2 to standard values ​​for selecting the payment application. The instruction's data field is filled with a 16-byte specific application identifier AID, which uniquely identifies the transportation smart card interoperability card-code integrated electronic ticket application described in this invention globally. The purpose of generating this instruction is to establish an application-level session with the mobile payment terminal and to specify the core application entity around which all subsequent transaction interactions revolve.

[0040] In step 22, the transaction terminal encodes and modulates the generated instructions using its integrated 13.56MHz contactless reader module, and transmits them as radio frequency signals to the mobile payment terminal within the effective communication range via an antenna. After transmission, the terminal immediately switches to receiving mode, continuously listening for responses from the mobile payment terminal. Upon receiving a response signal, the terminal demodulates, decodes, and reassembles it to reconstruct a complete APDU response message. This response data is the electronic ticket response data, the core of which is the Application File Control Information (FCI) data returned by the mobile payment terminal. The FCI data is encapsulated in TLV format and is a standardized description of the mobile payment terminal's internal card code fusion application attributes and structure, providing crucial input for subsequent terminal process decisions.

[0041] In step 23, the transaction terminal parses the received electronic ticket response data. The parsing process includes parsing the data format, verifying the basic integrity of the data, and extracting key fields. Through the parsing process, the transaction terminal obtains the transaction initialization instruction. The transaction initialization instruction is an internally generated control instruction whose content is based on the parsed information. It is used to guide the transaction terminal to enter the next stage of the interaction process, such as determining the security algorithm and terminal transaction attributes to be used subsequently. In step 24, the transaction terminal generates a balance check instruction. This instruction is a read record instruction or data retrieval instruction conforming to smart card specifications. The instruction generation module of the transaction terminal sets the parameter bytes or data fields of the instruction based on predetermined business rules and file system knowledge to clearly specify that the target of the requested read is the electronic wallet balance file within the electronic ticketing application. Generating this instruction is a standard step initiated by the transaction terminal to proactively probe the payment capabilities of the mobile payment terminal before executing core transaction logic that may involve fund deduction, aiming to determine whether the subsequent transaction mode should be pre-deducted or post-deducted.

[0042] In step 25, the transaction terminal sequentially sends the generated transaction initialization instruction (GPO) and balance check instruction to the mobile payment terminal via the near-field communication link. The terminal first sends the GPO instruction but does not process its response immediately; instead, it immediately sends the balance check instruction. Subsequently, the terminal receives the mobile payment terminal's response to the balance check instruction. This response data is the balance file data, which contains either a specific balance value or a specific error status code indicating that the balance file does not exist. The terminal temporarily stores this response data for subsequent critical logic checks.

[0043] In step 26, the transaction terminal processes the received balance file data. The terminal parses the response content using pre-defined business logic rules: if a valid value is obtained, it is determined to be the balance value, and the mobile payment terminal supports the pre-deduction mode; if a file not found status code is obtained, the mobile payment terminal supports the post-deduction mode. For the pre-deduction mode, the terminal further compares the balance value with the system's preset minimum transaction amount threshold. The judgment logic can be formalized as follows: if the response is a value and the balance value is greater than the minimum transaction amount threshold, an instruction to allow the pre-deduction transaction to continue is generated; if the response is a value but the balance value is less than the minimum transaction amount threshold, a transaction termination instruction is generated; if the response is a file not found status, an instruction to allow the post-deduction transaction to continue is generated. This decision instruction is the transaction control instruction.

[0044] In step 27, the transaction terminal sends a transaction control instruction to the mobile payment terminal. This instruction essentially notifies the mobile payment terminal whether and in what mode the transaction should continue. Subsequently, the transaction terminal continues to receive subsequent data returned by the mobile payment terminal according to the established protocol. This data includes: card-code fusion data, i.e., the complete set of interoperable transportation codes M; signature data, i.e., the digital signature Sig generated by the mobile payment terminal using the user's private key on M; and transaction credential data, i.e., the certificate TC for this offline transaction. Successful receipt of this data by the terminal signifies that the mobile payment terminal has completed the preparation of the core transaction data.

[0045] In step 28, the transaction terminal verifies the received card code fusion data, signature data, and transaction credential data. This verification process is completed offline and mainly includes three levels: First, verifying whether the format and logic of the card code fusion data conform to preset rules; second, verifying the signature data using a preset public key or one derived from the card code fusion data to ensure the integrity and authenticity of the transaction instruction; third, verifying whether the information in the transaction credential data is consistent with the context of this transaction. If all verifications pass, the transaction terminal generates the final transaction data, which includes at least a transaction success identifier, a transaction sequence number, and updated balance information. In step 29, the transaction terminal sends the final transaction result data obtained from the verification process to the mobile payment terminal via near-field communication. This transaction result data is typically a short status code, encapsulated in the status word SW1SW2 of the APDU response message. Sending this data constitutes the terminal's final confirmation and closure of this transaction interaction. Upon receiving this data, the mobile payment terminal can update the user interface display based on this status code. At this point, a complete card-code fusion transportation payment processing flow, led by the transaction terminal, is completed.

[0046] The technical solution described in this embodiment enables the transaction terminal and mobile payment terminal to complete all instruction and data interaction entirely through near-field communication. The entire transaction process does not require real-time online participation from the mobile network or back-end server, thus ensuring reliable transaction capabilities in network-free environments such as subways and underground spaces. Simultaneously, the transaction terminal automatically detects proximity and proactively initiates application selection commands, eliminating the need for the user to find and align with the QR code scanner. The transaction terminal verifies the compliance of the electronic ticket response data, embeds random numbers in the transaction initialization command to ensure transaction uniqueness, and ultimately executes a strict signature verification process—comparing the digest obtained from the decrypted signature with the digest of the real-time calculated data—effectively resisting data replay, man-in-the-middle attacks, and other fraudulent activities, thus ensuring transaction security.

[0047] In an optional embodiment of the present invention, step 23 involves parsing the electronic ticket response data to obtain a transaction initialization instruction, including: Step 231: Identify and process the electronic ticket response data to obtain a list of ticket type identifiers, algorithm identifiers, and processing option data objects; Step 232: Determine the transaction attribute data of the transaction terminal based on the processing option data object list; Step 233: Perform combined calculations on the ticket type identifier, algorithm identifier, and transaction attribute data to obtain the transaction initialization instruction.

[0048] In step 231 of this embodiment, the electronic ticket response data is identified and processed. The electronic ticket response data is Application File Control Information (FCI) data returned by the mobile payment terminal, and its structure follows the Tag Length Value (TLV) encoding standard. During the identification process, the transaction terminal's instruction processing module first performs sequential scanning and syntax analysis on the entire FCI data byte stream. The module needs to identify predefined tags with specific functional meanings. When a data object with a tag value of hexadecimal 9F71 is scanned, the module extracts all bytes within the object's value field and identifies it as the first ticket type currency code, i.e., the ticket type identifier applicable to this exchange. This data implicitly includes the city code, industry category, and pricing unit. Next, the module continues to scan and locate a data object with a tag value of hexadecimal DF00, extracts its value field content, and identifies it as an algorithm indicator, i.e., an algorithm identifier. This explicitly specifies the national cryptographic asymmetric cryptographic algorithm that must be used subsequently, such as the SM2 algorithm. Furthermore, the module also needs to identify and extract a data object with a tag value of hexadecimal 9F38, the value field content of which is the processing option data object list PDOL. PDOL itself is a list of multiple sub-tags that clearly defines the trading environment parameters that the trading terminal must provide and their order when generating subsequent instructions. Thus, three core elements have been identified and separated from the FCI data.

[0049] In step 232, transaction attribute data is determined based on the processing option data object list. After the transaction terminal obtains the PDOL, its instruction construction module parses each data object tag listed in the PDOL item by item. For each tag in the list, the module needs to search for or generate the corresponding data value in the transaction terminal's local database or real-time status. For example, if the PDOL contains a terminal transaction attribute with the tag hexadecimal 9F66, the module reads its preset transaction type, terminal performance, and other attribute values ​​from the terminal firmware. If it contains a transaction date with the tag hexadecimal 9A, the module obtains the current date and time from the terminal's real-time clock. If it contains an unpredictable number with the tag hexadecimal 9F37, the module calls its cryptographic random number generator to generate a secure random value. The module prepares all the corresponding data sequentially according to the complete tag sequence specified in the PDOL, and temporarily stores the original or encoded values ​​of these data in order, forming a structured set of transaction environment parameters. This set is the transaction attribute data of the transaction terminal. This step concretizes the PDOL requirement list into the actual data set required to fill the instructions.

[0050] In step 233, the ticket type identifier data, algorithm identifier data, and transaction attribute data are combined and processed. This combination is not simply mathematical calculation, but a process of logical assembly and protocol encapsulation. First, the instruction construction module determines the basic template and security requirements for this transaction based on the ticket type identifier data and algorithm identifier data, combined with the internal transaction logic. Then, the module uses the prepared complete transaction attribute data set as the main content of the data field. Next, the module constructs a complete APDU command structure according to the format of the GPO instruction for obtaining processing options in the ISO / IEC 7816-4 standard. This includes setting the correct instruction category byte, instruction code byte, and parameter byte, filling the aforementioned transaction attribute data set as the instruction's data field, and accurately calculating and setting the length of the data field. Finally, the module outputs a rigorously formatted and complete APDU command byte stream. This command is the transaction initialization instruction used to initiate the core transaction process, i.e., the GPO instruction. This instruction carries all the necessary transaction environment parameters, providing crucial input for the subsequent generation of signatures and transaction credentials by the mobile payment terminal.

[0051] In an optional embodiment of the present invention, step 28, which verifies the card code fusion data, signature data, and transaction credential data to obtain transaction result data, may include: Step 281: Obtain the verification public key data stored in the transaction terminal; Step 282: Based on the verification data and the signature data, perform signature verification operation on the card code fusion data to obtain signature verification result data; Step 283: Determine the transaction result data based on the verification result data and the transaction voucher data.

[0052] In step 281 of this embodiment, the near-field communication transaction terminal retrieves verification public key data from its internal secure storage area. This public key data corresponds precisely to the user's private key used by the mobile payment terminal to generate a digital signature.

[0053] In step 282, the transaction terminal performs signature verification processing on the card-code fusion data based on the acquired verification public key data and the received signature data. First, the terminal uses the same algorithm as when signing on the mobile payment terminal to process the complete card-code fusion data, i.e., the transportation interoperability code data set. Perform calculations to generate a fixed-length message digest. Subsequently, the terminal invokes the cryptographic operation library to execute the SM2 elliptic curve digital signature verification algorithm, a national standard for cryptographic algorithms.

[0054] In step 283, the transaction terminal combines the signature verification result data with the received transaction voucher data to determine the final transaction result data. If the signature verification result data indicates failure, the terminal directly generates status data indicating transaction failure, such as a specific error status code, regardless of the transaction voucher data. If the signature verification result data indicates success, the terminal continues to verify the transaction voucher data, including verifying its format standardization, validity period, and the legality of the digital signature on the voucher itself. Only when the signature verification is successful and the transaction voucher data passes verification will the terminal generate final transaction data indicating transaction success, usually a specific success status code. This transaction data will serve as the final decision on the offline transaction processing result, fed back to the mobile payment terminal via near-field communication, and may also be sent to the back-end clearing system along with the transaction voucher data to complete the closed loop.

[0055] In an optional embodiment of the present invention, the method for processing transit card code fusion transaction data further includes: Step 291, obtain the current time data; Step 292: Integrate the current time data and the transaction result data to obtain transaction log data; Step 293: Send the transaction voucher data and transaction log data to the settlement server.

[0056] In step 291 of this embodiment, the trading terminal reads the current precise date and time through its internally integrated real-time clock module. The processor of the trading terminal converts and formats this time information into a timestamp that conforms to industry standards. This timestamp typically uses Coordinated Universal Time (UTC) or local time format and is represented by a specific byte sequence. The purpose of obtaining the current time data is to assign a unique and sequential marker to this transaction. This marker is one of the core elements constituting an auditable and traceable transaction record and provides accurate time information for subsequent clearing and settlement.

[0057] In step 292, the log generation module of the transaction terminal performs this integration process. The transaction result data includes the core conclusions of this transaction, such as the status code for success or failure, the terminal's judgment result, the transaction amount, and key information from the transaction certificate (TC) data obtained from the mobile payment terminal, such as the transaction counter or pseudo-random number. The integration process is not a simple concatenation, but rather a data reorganization according to a predefined structured log format. This format specifies the position, length, and encoding method of each data field. The module uses the timestamp as the time header field of the log, and then sequentially fills the various elements of the transaction result data into the corresponding fields in the log format, such as the status field, amount field, terminal identifier field, and transaction certificate field. After filling, the module calculates the checksum of the entire log data block, such as a cyclic redundancy check (CRC) code, and appends it to the end of the log to ensure the integrity of the log data during storage and transmission. The final output, a complete data packet containing time, result, and checksum information, is the transaction log data for this transaction.

[0058] In step 293, the transaction credential data, namely the Transaction Certificate (TC) data returned by the mobile payment terminal, is the key cryptographic credential for the legitimacy of offline transactions. The transaction terminal first assembles the TC data and transaction log data, possibly encapsulating them according to the communication protocol message format required by the settlement system, such as adding a message header, specifying data type identifiers, and padding length fields. Subsequently, the terminal establishes a secure connection with the remote settlement server through its network communication interface, such as Ethernet, 4G / 5G mobile networks, or dedicated lines, for example, using Transport Layer Security (TLS). After the connection is established, the terminal sends the assembled data message to the settlement server. This transmission process is asynchronous and may be executed immediately after the transaction is completed, or it may be executed by the terminal during subsequent network downtime or batch upload periods. Upon receiving this data, the settlement server parses it, verifies the TC signature, and performs clearing, settlement, and subsequent error handling based on the transaction log. This step completes the closed loop of transaction data from the offline terminal to the online backend system, realizing the "ride now, pay later" credit payment model.

[0059] like Figures 3 to 5As shown, a specific embodiment of the card-code fusion transaction data processing method for transportation cards provided in this invention is as follows: Step 1: Initialize the mobile payment application and synchronize data with the cloud.

[0060] Users open a transportation payment app on their smartphones and actively activate the "card-code integrated e-ticket" function. This module then establishes a secure connection with a remote cloud server via HTTPS and initiates a data initialization request. After verifying the user's identity, the cloud server retrieves the user's corresponding transportation interoperability account information from its database and generates a set of personalized transportation interoperability code data foundation fields. These fields include data elements such as city code, industry code, card application serial number, issuing institution identifier, and application version. Simultaneously, the cloud server uses the issuing institution's master key and a specific key derivation function to generate a unique application maintenance key and personalized signature private key for the user. Finally, the cloud server packages the code data foundation fields and the encrypted key materials and sends them to the mobile payment terminal. Upon receiving the data packet, the mobile payment terminal securely stores the personalized signature private key in a secure area; simultaneously, it caches the plaintext code data foundation fields according to a predefined structure within the application sandbox, thus completing the localized deployment and data preparation of the e-ticket application.

[0061] Step 2: Establish a near-field communication connection and complete the application selection.

[0062] When a user needs to take a ride, they bring their mobile phone, equipped with the prepared application, close to a transaction terminal such as a bus fare collection machine or subway gate. After the transaction terminal's RF module senses the mobile device within the NFC field, it first sends a PPSE command to detect the payment environment. Upon receiving the PPSE command, the mobile payment terminal returns a list of supported payment applications, which includes the AID of the card-code fusion application of this invention. Based on the returned list, the transaction terminal sends a SELECT command to select the application. The header of this command conforms to the ISO / IEC 7816-4 standard, and its data field explicitly contains the 16-byte card-code fusion application AID. The HCE host card emulation service of the mobile payment terminal receives and parses this command. After confirming the AID match, it retrieves the Application File Control Information (FCI) data bound to the AID from its local cache. This FCI data is encoded in TLV format and contains not only the basic attributes of the application but, more importantly, the ticket type identifier (label 9F71), the algorithm identifier (label DF00), and the processing option data object list (PDOL) (label 9F38). The mobile payment terminal encapsulates this FCI data into a response message and replies to the transaction terminal via the NFC link, thereby completing the application layer handshake and capability exchange. The transaction terminal then learns the card's attributes and the rules for subsequent interactions.

[0063] Step 3, Processing according to transaction mode: Transaction initialization and data preparation for the post-deduction process.

[0064] If the user uses a credit-based payment model with debit / credit charges, after parsing the FCI, the transaction terminal will collect transaction environment data, including the terminal transaction time, terminal code, and a cryptographically secure random number, according to the PDOL requirements. Subsequently, the terminal generates and sends a GPO instruction, whose data field carries the aforementioned environment data. Upon receiving the GPO instruction, the mobile payment terminal parses out the crucial transaction time. T and random numbers Rnd Then, the mobile payment terminal executes the core logic: First, it determines the SM2 national cryptographic algorithm to be used based on the ticket type identifier and algorithm identifier; after the business logic judgment is passed, the electronic ticket dynamically generates an Application File Locator (AFL) based on the selected ticket type, the card file structure, and the data storage location of the code that needs to be returned to the terminal.

[0065] At the same time, use the card issuer's private key to contain T , Rnd The transaction dataset containing the data is signed to generate a transaction certificate (TC).

[0066] Finally, the mobile payment terminal returns the AFL and TC as a response to the GPO instruction to the terminal. Upon receiving the AFL, the terminal can send a read record instruction, retrieving the complete, pre-stored Traffic Interconnection Near Field Communication (TNFC) interoperability code data set M from the mobile payment terminal based on the file identifier SFI and record number indicated by the AFL. Simultaneously with returning the code data M, the mobile payment terminal uses the user's private key to instantly sign M according to the SM2 signature algorithm, generating a signature value. .

[0067] The mobile payment terminal will obtain the near-field communication interoperability code data set M and digital signature. The generated transaction certificate data is then assembled according to a predetermined data format. Once assembled, the mobile payment terminal sends this complete data packet to the transaction terminal via NFC communication. After transmission, the mobile payment terminal switches to receiving mode, awaiting final processing feedback from the transaction terminal.

[0068] After receiving the data packet, the transaction terminal independently performs signature verification. It uses the public key corresponding to the user's private key to verify the signature. If the verification passes, a success status code is generated; otherwise, a failure code is generated. The mobile payment terminal receives this status code. If the status code indicates success, it prompts the user on the mobile phone interface with "Transaction successful," completing the "ride now, pay later" process; if it indicates failure, it displays the corresponding error message.

[0069] Step 4, process according to transaction mode: balance verification and transaction completion of the pre-deduction process.

[0070] If the user uses the prepaid mode, a balance verification step is added to the transaction process before sending the GPO instruction. After sending SELECT AID and receiving the FCI response, the terminal first sends an instruction to read the balance. The mobile payment terminal retrieves the current balance value from the local e-wallet file and returns it to the terminal. Only after the terminal determines that the balance is sufficient will it continue with the subsequent steps. The subsequent steps, such as sending the GPO instruction, generating AFL / TC, reading code data, and generating a signature, are basically the same as the post-deduction process. However, the key difference is that before generating the TC, the mobile payment terminal will again confirm whether the balance is sufficient to pay the minimum fare for this transaction. After the terminal successfully verifies the signature and the transaction is approved, the transaction terminal will send another instruction to update the balance. The mobile payment terminal receives this instruction, performs the deduction calculation in a secure environment: new balance = current balance - transaction amount, and writes the result back to the e-wallet file. To ensure the atomicity of the deduction, this process is usually bound to the TC generation logic to ensure that if the deduction fails, the transaction is invalid. Finally, the terminal sends the TC containing the deducted amount to the clearing center, completing the "prepaid, then ride" closed loop. Throughout the process, all sensitive operations, such as signature generation and balance updates, are completed within the device's application environment, ensuring payment security.

[0071] Step 5: Submit transaction vouchers for clearing and settlement.

[0072] Regardless of whether a debit or credit transaction is used, an encrypted transaction log is generated after each card transaction. This log contains at least the core credential (TC), transaction time, terminal number, transaction type (debit / recharge), and transaction result. When the terminal detects available Wi-Fi or cellular network, the application automatically initiates a data upload task. It connects to the cloud clearing and settlement server via a TLS secure link and uploads the packaged transaction logs in batches. After receiving the logs, the cloud server first decrypts and verifies the legality of the TC signature to confirm the authenticity of the transaction. Subsequently, the system matches the transaction record with the corresponding public transport operator and acquiring institution based on the transaction serial number, terminal number, and user identifier in the TC, and performs clearing operations. For debit transactions, the system generates a bill to be paid and periodically deducts the amount from the user's linked credit or payment account; for credit transactions, it directly updates the user's card balance. This step efficiently and accurately connects the massive number of transactions occurring offline at the front end with the back-end fund settlement and error handling platform, achieving the completeness of the "card-code fusion" solution at the commercial operation level.

[0073] The transportation smart card transaction data processing method proposed in this invention integrates transportation interconnection QR code data and NFC card data at the electronic ticket terminal, and performs signature and verification of key transaction data based on the national cryptographic SM2 algorithm. This effectively solves the problems of fraudulent use, network dependence, and low passage efficiency in QR code payment, and realizes a safe, efficient transportation experience that supports the "pass first, pay later" credit payment mode. At the same time, it provides verifiable and traceable transaction vouchers for the clearing and settlement system and improves the error handling mechanism.

[0074] like Figure 6 As shown, this embodiment of the invention also provides a card-code fusion transaction data processing device 60 for transportation cards, applied to near-field communication mobile payment terminals, including: The acquisition module 61 is used to acquire electronic ticket data from the mobile payment terminal, wherein the electronic ticket data includes a target application identifier, a ticket type identifier, and an algorithm identifier; The determining module 62 is used to determine the card code fusion data based on the electronic ticket data; The acquisition module 61 is also used to acquire the card code fusion electronic ticket transaction instructions sent by the transaction terminal through near-field communication; The determining module 62 is also used to determine the electronic ticket response data based on the card code fusion electronic ticket transaction instruction; The first transceiver module 63 is used to send the electronic ticket response data to the transaction terminal via near-field communication, and to interact with the transaction terminal to determine the signature data and transaction voucher data; to send the card code fusion data, signature data and transaction voucher data to the transaction terminal, and to receive the transaction result data returned by the transaction terminal, wherein the transaction result data is obtained by the transaction terminal through offline verification processing of the card code fusion data, signature data and transaction voucher data.

[0075] Optionally, processing module 62 is specifically used for: The electronic ticket data is sent to the cloud server, and the code data and pre-authorization voucher data generated by the cloud server based on the electronic ticket data are received. Obtain the user's private key data from the mobile payment terminal; Based on the user's private key data, the electronic ticket data and code data are fused to obtain card-code fused data.

[0076] Optionally, the processing module 62 is also specifically used for: Based on the card-code fusion electronic ticket transaction instruction, the target application identifier, ticket type identifier, and algorithm identifier are integrated and processed to obtain electronic ticket response data.

[0077] Optionally, the first transceiver module 63 is specifically used for: The system receives a transaction initialization command sent by the transaction terminal, which is obtained by the transaction terminal parsing and processing the response data of the electronic ticket card. The transaction initialization instruction is parsed and processed to obtain the transaction time and random number; Receive balance check instructions sent by the transaction terminal; According to the balance detection instruction, obtain the balance file data pre-stored in the mobile payment terminal file system; The balance file data is sent to the transaction terminal, and a transaction control instruction is received. The transaction control instruction is obtained by the transaction terminal through judgment and processing of the balance file data. According to the transaction control instruction, the transaction time and the random number are combined and processed to obtain signature data and transaction voucher data.

[0078] Optionally, according to the transaction control instruction, the transaction time and the random number are combined and processed to obtain signature data and transaction voucher data, including: The transaction control instruction is parsed and processed to obtain the balance status identifier; When the balance status is identified as a first preset value, the following formula is used: Sig1=SM2_Sign[ sk , C ∥ T ∥ R ], Generate signature data for scenarios with a balance, where Sig1 is the signature data for scenarios with a balance; sk This represents the user's private key data; ∥ represents the string concatenation operation. T For trading hours; R It is a random number; C For card code fusion data; SM2_Sign( ) is the signature function; according to: TC1=MAC8(SM 4Encrypt (DeriveKey(acKeymaster, ATC), Padding( B ∥Ver enc ),Sig1)), Generate transaction voucher data, where TC1 is the transaction voucher data for scenarios with a balance; ATC is the application transaction counter; acKeymaster is the master key for the application ciphertext; Ver enc Data elements generated for ciphertext version 18; SM 4Encrypt ( ) is the national standard SM4 encryption function; MAC8 ( The function `padding(` outputs an 8-byte message authentication code) is used to output the authentication code. ) is the fill function; DeriveKey( ) is the key derivation function; When the balance status is identified as the second preset value, then the formula is used: Sig0=SM2_Sign[ sk , C ∥ T ∥ R ∥ Auth ], Generate signature data for a no-balance scenario, where Sig0 is the signature data for a no-balance scenario; Auth This is pre-authorization credential data; according to: TC0=MAC8(SM 4Encrypt (DeriveKey(acKeymaster, ATC), Padding Auth ∥Ver enc ), Sig0)), Generate transaction voucher data for a no-balance scenario, where TC0 is the transaction voucher data for a no-balance scenario.

[0079] It should be noted that this device is a device corresponding to the card code fusion transaction data processing method for transportation cards applied to near-field communication mobile payment terminals described above. All implementation methods in the above method embodiments are applicable to this embodiment and can achieve the same technical effect.

[0080] like Figure 7 As shown, this embodiment of the invention also provides a card-code fusion transaction data processing device 70 for transportation cards, applied to near-field communication transaction terminals, including: Generation module 71 is used to generate card-code fusion electronic ticket transaction instructions; The second transceiver module 72 is used to send the card-code integrated electronic ticket transaction instruction to the mobile payment terminal and receive the electronic ticket response data returned by the mobile payment terminal. Processing module 73 is used to parse and process the electronic ticket response data to obtain a transaction initialization instruction; The generation module 71 is also used to generate balance detection instructions; The second transceiver module 72 is also used to send the transaction initialization instruction and balance detection instruction to the mobile payment terminal, and to receive the balance file data returned by the mobile payment terminal; The processing module 73 is also used to perform judgment processing on the balance file data to obtain transaction control instructions; The second transceiver module 72 is also used to send the transaction control instruction to the mobile payment terminal, and receive the card code fusion data, signature data and transaction certificate data returned by the mobile payment terminal; The processing module 73 is also used to verify the card code fusion data, signature data and transaction certificate data to obtain transaction result data; The second transceiver module 72 is also used to send the transaction result data to the mobile payment terminal.

[0081] Optionally, processing module 73 is specifically used for: The electronic ticket response data is identified and processed to obtain a list of ticket type identifiers, algorithm identifiers, and processing option data objects; Based on the list of processing option data objects, determine the transaction attribute data of the transaction terminal; The ticket type identifier, algorithm identifier, and transaction attributes are combined and processed to obtain the transaction initialization instruction.

[0082] Optionally, the second processing module 73 is also specifically used for: Retrieve the verification public key data stored in the transaction terminal; Based on the verification data and the signature data, the card code fusion data is processed by signature verification to obtain signature verification result data; Based on the verification result data and the transaction voucher data, the transaction result data is determined.

[0083] It should be noted that this device is a device corresponding to the card code fusion transaction data processing method for transportation cards applied to near-field communication transaction terminals described above. All implementation methods in the above method embodiments are applicable to this embodiment and can achieve the same technical effect.

[0084] The above are preferred embodiments of the present invention. It should be noted that, for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A method for processing transaction data fusion of a transportation card and its code, characterized in that, Applications to near-field communication mobile payment terminals include: Obtain electronic ticket data from the mobile payment terminal, wherein the electronic ticket data includes the target application identifier, ticket type identifier, and algorithm identifier; Based on the electronic ticket data, determine the card code fusion data; Obtain the card-code fusion electronic ticket transaction instructions sent by the transaction terminal via near-field communication; Based on the card-code fusion electronic ticket transaction instruction, determine the electronic ticket response data; The electronic ticket response data is sent to the transaction terminal via near-field communication, and the transaction terminal is interacted with to determine the signature data and transaction voucher data. The card code fusion data, signature data, and transaction certificate data are sent to the transaction terminal, and the transaction result data returned by the transaction terminal is received. The transaction result data is obtained by the transaction terminal through offline verification processing of the card code fusion data, signature data, and transaction certificate data.

2. The method for processing card-code fusion transaction data of a transportation card according to claim 1, characterized in that, Based on the electronic ticket data, the card code fusion data is determined, including: The electronic ticket data is sent to the cloud server, and the code data and pre-authorization voucher data generated by the cloud server based on the electronic ticket data are received. Obtain the user's private key data from the mobile payment terminal; Based on the user's private key data, the electronic ticket data and code data are fused to obtain card-code fused data.

3. The method for processing transaction data of a transportation card fusion system according to claim 2, characterized in that, Based on the card-code fusion electronic ticket transaction instruction, determine the electronic ticket response data, including: Based on the card-code fusion electronic ticket transaction instruction, the target application identifier, ticket type identifier, and algorithm identifier are integrated and processed to obtain electronic ticket response data.

4. The method for processing transaction data of a transportation card fusion system according to claim 3, characterized in that, The electronic ticket response data is sent to the transaction terminal via near-field communication, and commands are exchanged with the transaction terminal to determine signature data and transaction voucher data, including: The system receives a transaction initialization command sent by the transaction terminal, which is obtained by the transaction terminal parsing and processing the response data of the electronic ticket card. The transaction initialization instruction is parsed and processed to obtain the transaction time and random number; Receive balance check instructions sent by the transaction terminal; According to the balance detection instruction, obtain the balance file data pre-stored in the mobile payment terminal file system; The balance file data is sent to the transaction terminal, and a transaction control instruction is received. The transaction control instruction is obtained by the transaction terminal through judgment and processing of the balance file data. According to the transaction control instruction, the transaction time and the random number are combined and processed to obtain signature data and transaction voucher data.

5. The method for processing transaction data of a transportation card fusion system according to claim 4, characterized in that, According to the transaction control instruction, the transaction time and the random number are combined and processed to obtain signature data and transaction voucher data, including: The transaction control instruction is parsed and processed to obtain the balance status identifier; When the balance status is identified as a first preset value, the following formula is used: Sig1=SM2_Sign[ sk , C ∥ T ∥ R ], Generate signature data for scenarios with a balance, where Sig1 is the signature data for scenarios with a balance; sk This represents the user's private key data; ∥ represents the string concatenation operation. T For trading hours; R It is a random number; C For card code fusion data; SM2_Sign( ) is the signature function; according to: TC1=MAC8(SM 4Encrypt (DeriveKey(acKeymaster, ATC), Padding( B ∥Ver enc ), Sig1)), Generate transaction voucher data, where TC1 is the transaction voucher data for scenarios with a balance; ATC is the application transaction counter; acKeymaster is the master key for application encryption; Ver enc Data elements generated for ciphertext version 18; SM 4Encrypt ( ) is the national standard SM4 encryption function; MAC8 ( The function `padding(` outputs an 8-byte message authentication code)` is used to output the authentication code. ) is the fill function; DeriveKey( ) is the key derivation function; When the balance status is identified as the second preset value, then the formula is used: Sig0=SM2_Sign[ sk , C ∥ T ∥ R ∥ Auth ], Generate signature data for a no-balance scenario, where Sig0 is the signature data for a no-balance scenario; Auth This is pre-authorization credential data; according to: TC0=MAC8(SM 4Encrypt (DeriveKey(acKeymaster, ATC), Padding( Auth ∥Ver enc ), Sig0)), Generate transaction voucher data for a no-balance scenario, where TC0 is the transaction voucher data for a no-balance scenario.

6. A method for processing transaction data fusion of a transportation card and its code, characterized in that, Applications to near-field communication transaction terminals include: Generate card code fusion electronic ticket transaction instructions; The card-code fused electronic ticket transaction instruction is sent to the mobile payment terminal, and the electronic ticket response data returned by the mobile payment terminal is received. The electronic ticket response data is parsed and processed to obtain the transaction initialization command; Generate balance check instruction; The transaction initialization command and balance detection command are sent to the mobile payment terminal, and the balance file data returned by the mobile payment terminal is received. The balance file data is processed to obtain transaction control instructions; The transaction control instruction is sent to the mobile payment terminal, and the card code fusion data, signature data, and transaction certificate data returned by the mobile payment terminal are received. The card code fusion data, signature data, and transaction credential data are verified to obtain transaction result data. The transaction result data is sent to the mobile payment terminal.

7. The method for processing transaction data of a transportation card fusion system according to claim 6, characterized in that, The electronic ticket response data is parsed and processed to obtain transaction initialization instructions, including: The electronic ticket response data is identified and processed to obtain a list of ticket type identifiers, algorithm identifiers, and processing option data objects; Based on the list of processing option data objects, determine the transaction attribute data of the transaction terminal; The ticket type identifier, algorithm identifier, and transaction attributes are combined and processed to obtain the transaction initialization instruction.

8. The method for processing transaction data of a transportation card fusion system according to claim 6, characterized in that, The card code fusion data, signature data, and transaction credential data are verified to obtain transaction result data, including: Retrieve the verification public key data stored in the transaction terminal; Based on the verification data and the signature data, the card code fusion data is processed by signature verification to obtain signature verification result data; Based on the verification result data and the transaction voucher data, the transaction result data is determined.

9. A device for processing transaction data fusion of a transportation card and its code, characterized in that, Applications to near-field communication mobile payment terminals include: The acquisition module is used to acquire electronic ticket data from the mobile payment terminal. The electronic ticket data includes the target application identifier, ticket type identifier, and algorithm identifier. The determining module is used to determine the card code fusion data based on the electronic ticket data; The acquisition module is also used to acquire the card-code fusion electronic ticket transaction instructions sent by the transaction terminal via near-field communication. The determining module is also used to determine the electronic ticket response data based on the card code fusion electronic ticket transaction instruction; The first transceiver module is used to send the electronic ticket response data to the transaction terminal via near-field communication, and to interact with the transaction terminal to determine the signature data and transaction voucher data; to send the card code fusion data, signature data, and transaction voucher data to the transaction terminal, and to receive the transaction result data returned by the transaction terminal, wherein the transaction result data is obtained by the transaction terminal through offline verification processing of the card code fusion data, signature data, and transaction voucher data.

10. A device for processing transaction data fusion of a transportation card and its code, characterized in that, Applications to near-field communication transaction terminals include: The generation module is used to generate electronic ticket transaction instructions that integrate card and code. The second transceiver module is used to send the card-code integrated electronic ticket transaction instruction to the mobile payment terminal and receive the electronic ticket response data returned by the mobile payment terminal. The processing module is used to parse and process the electronic ticket response data to obtain the transaction initialization instruction; The generation module is also used to generate balance detection instructions; The second transceiver module is also used to send the transaction initialization instruction and balance detection instruction to the mobile payment terminal, and to receive the balance file data returned by the mobile payment terminal; The processing module is also used to perform judgment processing on the balance file data to obtain transaction control instructions; The second transceiver module is also used to send the transaction control instruction to the mobile payment terminal, and to receive the card code fusion data, signature data and transaction certificate data returned by the mobile payment terminal; The processing module is also used to verify the card code fusion data, signature data and transaction certificate data to obtain transaction result data; The second transceiver module is also used to send the transaction result data to the mobile payment terminal.