Data interaction method, system and computer readable storage medium

By sending payment messages to a security server for security verification at the receiving server and using SM2 and SM4 algorithms for two-way authentication, the security and identity verification issues of sensitive data in direct bank-enterprise payments are resolved, thereby improving the security and efficiency of the digital RMB payment process.

CN114596084BActive Publication Date: 2026-02-03SHENZHEN ZHENGTONG ELECTRONIC CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210148730.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-17
Publication Date
2026-02-03
Estimated Expiration
2042-02-17

AI Technical Summary

Technical Problem

In the process of digital RMB payment through direct bank-enterprise connection, fixed public IP servers are easily compromised, which makes it impossible to guarantee the security of sensitive data. Furthermore, the receiving terminal cannot directly initiate payment requests to the acquiring bank, resulting in issues such as identity verification, data tampering prevention, and communication link anomalies.

Method used

The payment server sends the payment message to the security server for security verification. After receiving the payment ciphertext and the acquiring bank address, it sends a payment request to the acquiring bank and forwards the response message to ensure that the payment server does not involve sensitive information. It uses SM2 public key certificates and SM4 algorithm for two-way authentication and key negotiation to improve the security of the payment process.

Benefits of technology

It improves the security of sensitive information during the digital RMB payment process, meets the requirement that the receiving terminal cannot directly send payment requests to the acquiring bank, and enhances the security and speed of payment transactions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114596084B_ABST
    Figure CN114596084B_ABST
Patent Text Reader

Abstract

The application discloses a data interaction method and system and a computer readable storage medium, wherein the method comprises the following steps: receiving a payment message sent by a payment terminal, and sending the payment message to a security server; when receiving a payment ciphertext and an address of an acquirer sent by the security server, sending a payment request to an acquirer terminal according to the payment ciphertext and the address of the acquirer, so that the acquirer terminal completes a payment operation corresponding to the payment request when receiving the payment request, and sends a response message to the payment terminal based on the payment operation; and forwarding the response message to the payment terminal when receiving the response message sent by the acquirer terminal. The application aims to improve the security of sensitive data in the unified payment process of the direct connection between banks and enterprises.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of smart payment technology, and in particular to a data interaction method, system, and computer-readable storage medium. Background Technology

[0002] The digital yuan is an important component of my country's financial technology reform. In order to promote the digital yuan, it needs to be compatible with traditional electronic payment methods.

[0003] In the scenario of direct bank-enterprise connection for electronic payments, merchants have their own payment terminals—POS terminals. Direct payment transactions need to be initiated from the merchant's payment terminal. QR code payment is an important method of electronic payment, and it is divided into two modes: the scanned mode and the active scan mode. In the scanned mode, the merchant enters the payment amount on the POS terminal and uses the POS terminal to scan the payment code provided by the customer to complete the payment. In the scanned mode, some acquiring banks do not allow the POS terminal to directly initiate payment requests to the acquiring bank's backend. They only allow a server with a fixed public IP address to initiate digital RMB QR code payment requests. However, servers with fixed public IP addresses are easily hacked and their data modified, resulting in a lack of security guarantees for the storage and access of sensitive data when digital RMB is used for unified payment collection.

[0004] The above content is only used to help understand the technical solution of the present invention and does not represent an admission that the above content is prior art. Summary of the Invention

[0005] The main objective of this invention is to provide a data interaction method, system, and computer-readable storage medium, aiming to improve the security of sensitive data in the unified payment process of direct bank-enterprise connection of digital RMB.

[0006] To achieve the above objectives, the present invention provides a data interaction method applied to a payment server, the data interaction method comprising:

[0007] Receive the payment message sent by the payment terminal and send the payment message to the security server;

[0008] Upon receiving the payment ciphertext and acquiring bank address sent by the secure server, a payment request is sent to the acquiring bank based on the payment ciphertext and acquiring bank address, so that the acquiring bank completes the payment operation corresponding to the payment request upon receiving the payment request, and sends a response message to the receiving server based on the payment operation;

[0009] Upon receiving a response message from the acquiring bank, the bank forwards the response message to the payment terminal.

[0010] Optionally, before the step of receiving the payment message sent by the payment terminal and sending the payment message to the security server, the method further includes:

[0011] Invoke the security component;

[0012] After performing two-way authentication between the security component and the payment terminal, a communication key is negotiated with the payment terminal, and the validity period of the communication key is determined.

[0013] The communication key and its validity period are sent to the security server.

[0014] Optionally, the payment message is a receipt message or a payment result query message.

[0015] Furthermore, to achieve the above objectives, the present invention also provides a data interaction method applied to a security server, the data interaction method comprising:

[0016] Receive payment messages sent by the payment server and determine merchant information based on the payment messages;

[0017] The communication key and the validity period of the communication key are obtained based on the merchant information.

[0018] If the communication key is valid within the specified time, the payment message can be decrypted using the communication key to obtain payment information.

[0019] The security key is obtained based on the merchant information. The payment information is reassembled based on the security key and the payment protocol with the acquiring bank to obtain the payment plaintext. The payment ciphertext is determined based on the security components provided by the acquiring bank and the payment plaintext.

[0020] The payment ciphertext and the acquiring bank address are sent to the payment server.

[0021] Optionally, before the step of obtaining the communication key and the validity period of the communication key based on the merchant information, the method further includes:

[0022] Obtain the signature verification key based on the merchant information;

[0023] The signature value of the receiving terminal is determined based on the payment message;

[0024] Determine whether the signature value is correct based on the verification key;

[0025] If the signature value is correct, then the steps of obtaining the communication key and the validity period of the communication key based on the merchant information are performed.

[0026] Furthermore, to achieve the above objectives, the present invention also provides a data interaction method applied to a payment terminal, the data interaction method comprising:

[0027] Obtain payment information and determine the payment message based on the communication key negotiated with the payment server and the payment information;

[0028] A payment message sent to the payment server, wherein the payment message is a payment receipt message or a payment result query message;

[0029] When receiving the response message forwarded by the payment server, examine the response message;

[0030] If the response message corresponds to a payment message, then a payment result query message is sent to the payment server based on the order number in the response message;

[0031] If the response message corresponds to a payment result query message, then the payment status is determined based on the payment result query message.

[0032] Optionally, the step of obtaining payment information and determining the payment message based on the communication key negotiated with the payment server and the payment information includes:

[0033] Obtain payment information, wherein the payment information is a payment code, order number, amount, or the payment information is an order number;

[0034] The payment information is encrypted into ciphertext data based on the communication key;

[0035] The signature value is determined based on the private key of the payment terminal;

[0036] The merchant information, the encrypted data, and the signature value are packaged into the payment message according to the payment message protocol between the payment terminal and the payment server.

[0037] Optionally, before the step of determining the payment message based on the communication key negotiated with the payment server and the payment information, the method further includes:

[0038] Invoke the security component;

[0039] After performing two-way authentication between the security component and the payment server, a communication key is negotiated with the payment server, and the validity period of the communication key is determined.

[0040] The communication key is associated with and stored in the payment terminal along with its validity period.

[0041] In addition, to achieve the above objectives, the present invention also provides a data interaction system, which includes: a payment terminal, a payment server, and a security server;

[0042] The payment terminal performs the steps of the data interaction method described above;

[0043] The payment server executes the steps of the data interaction method described above.

[0044] The security server executes the steps of the data interaction method described above.

[0045] In addition, to achieve the above objectives, the present invention also provides a computer-readable storage medium storing a data interaction program, which, when executed by a processor, implements the steps of the data interaction method described above.

[0046] This invention proposes a data interaction method, system, and computer-readable storage medium. First, a payment message sent by a payment terminal is received and then sent to a secure server. Upon receiving encrypted payment text and an acquiring bank address from the secure server, a payment request is sent to the acquiring bank based on the encrypted payment text and the acquiring bank address. This enables the acquiring bank to complete the payment operation corresponding to the payment request upon receipt and send a response message to the payment server based on the payment operation. Upon receiving the response message from the acquiring bank, the response message is forwarded to the payment terminal. In this way, where the receiving terminal and the acquiring bank cannot interact directly, the receiving server acts as a shared relay station for both the receiving terminal and the acquiring bank. It does not store sensitive information. When it receives a payment message, it sends the payment message to the security server for security verification. It also receives the acquiring bank address and payment ciphertext from the security server, and sends a payment request to the acquiring bank based on the acquiring bank address and payment ciphertext. It then forwards the response message sent by the acquiring bank to the receiving terminal. In this process, the receiving server does not handle sensitive information. Therefore, the security of sensitive information in the unified payment process of direct bank-enterprise connection of digital RMB can be improved. Attached Figure Description

[0047] Figure 1 This is a schematic diagram of the terminal structure of the hardware operating environment involved in the embodiments of the present invention;

[0048] Figure 2 This is a flowchart illustrating an embodiment of the data interaction method of the present invention;

[0049] Figure 3 This is a flowchart illustrating another embodiment of the data interaction method of the present invention;

[0050] Figure 4 This is a flowchart illustrating another embodiment of the data interaction method of the present invention;

[0051] Figure 5This is a signaling flowchart for an application scenario according to an embodiment of the present invention.

[0052] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

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

[0054] Due to the regulations of some acquiring banks, payment terminals cannot directly initiate digital RMB payment requests to the acquiring bank. Instead, they can only initiate payment requests from servers with fixed public IP addresses. However, servers with public IP addresses are easily compromised, which means that the security of sensitive data passing through or stored on public IP servers cannot be guaranteed.

[0055] To improve the security of sensitive information, embodiments of the present invention propose a data interaction method, system, and computer-readable storage medium, wherein the main steps of the method include:

[0056] Receive the payment message sent by the payment terminal and send the payment message to the security server;

[0057] Upon receiving the payment ciphertext and acquiring bank address sent by the secure server, a payment request is sent to the acquiring bank based on the payment ciphertext and acquiring bank address, so that the acquiring bank completes the payment operation corresponding to the payment request upon receiving the payment request, and sends a response message to the receiving server based on the payment operation;

[0058] Upon receiving a response message from the acquiring bank, the bank forwards the response message to the payment terminal.

[0059] This approach involves forwarding the received payment message to a secure server for security verification. The payment request is then sent based on the encrypted payment message and the acquiring bank's address provided by the secure server. During this process, the receiving server does not handle any sensitive information. Therefore, the solution described in the above embodiment can improve the security of sensitive information during the unified payment process of the digital RMB.

[0060] The claims of this invention will be described in detail below with reference to the accompanying drawings.

[0061] like Figure 1 As shown, Figure 1 This is a schematic diagram of the terminal structure of the hardware operating environment involved in the embodiments of the present invention.

[0062] In this embodiment of the invention, the terminal can be a payment server, a security server, or a payment terminal, and a data interaction system can run on the terminal.

[0063] like Figure 1 As shown, the terminal may include: a processor 1001, such as a CPU, a memory 1003, and a communication bus 1002. The communication bus 1002 is used to enable communication between these components. The memory 1003 may be a high-speed RAM or a stable, non-volatile memory, such as a disk drive. Optionally, the memory 1003 may also be a storage device independent of the aforementioned processor 1001.

[0064] Those skilled in the art will understand that Figure 1 The terminal structure shown does not constitute a limitation on the terminal and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0065] like Figure 1 As shown, the memory 1003, which serves as a computer storage medium, may include an operating system and a data interaction program.

[0066] exist Figure 1 In the terminal shown, the processor 1001 can be used to call the data interaction program stored in the memory 1003 and perform the following operations:

[0067] Receive the payment message sent by the payment terminal and send the payment message to the security server;

[0068] Upon receiving the payment ciphertext and acquiring bank address sent by the secure server, a payment request is sent to the acquiring bank based on the payment ciphertext and acquiring bank address, so that the acquiring bank completes the payment operation corresponding to the payment request upon receiving the payment request, and sends a response message to the receiving server based on the payment operation;

[0069] Upon receiving a response message from the acquiring bank, the bank forwards the response message to the payment terminal.

[0070] Furthermore, the processor 1001 can call the data interaction program stored in the memory 1003 and also perform the following operations:

[0071] Invoke the security component;

[0072] After performing two-way authentication between the security component and the payment terminal, a communication key is negotiated with the payment terminal, and the validity period of the communication key is determined.

[0073] The communication key and its validity period are sent to the security server.

[0074] Optionally, the processor 1001 may call the data interaction program stored in the memory 1003 and further perform the following operations:

[0075] Receive payment messages sent by the payment server and determine merchant information based on the payment messages;

[0076] The communication key and the validity period of the communication key are obtained based on the merchant information.

[0077] If the communication key is valid within the specified time, the payment message can be decrypted using the communication key to obtain payment information.

[0078] The security key is obtained based on the merchant information. The payment information is reassembled based on the security key and the payment protocol with the acquiring bank to obtain the payment plaintext. The payment ciphertext is determined based on the security components provided by the acquiring bank and the payment plaintext.

[0079] The payment ciphertext and the acquiring bank address are sent to the payment server.

[0080] Furthermore, the processor 1001 can call the data interaction program stored in the memory 1003 and also perform the following operations:

[0081] Obtain the signature verification key based on the merchant information;

[0082] The signature value of the receiving terminal is determined based on the payment message;

[0083] Determine whether the signature value is correct based on the verification key;

[0084] If the signature value is correct, then the steps of obtaining the communication key and the validity period of the communication key based on the merchant information are performed.

[0085] Optionally, the processor 1001 may call the data interaction program stored in the memory 1003 and further perform the following operations:

[0086] Obtain payment information and determine the payment message based on the communication key negotiated with the payment server and the payment information;

[0087] A payment message sent to the payment server, wherein the payment message is a payment receipt message or a payment result query message;

[0088] When receiving the response message forwarded by the payment server, examine the response message;

[0089] If the response message corresponds to a payment message, then a payment result query message is sent to the payment server based on the order number in the response message;

[0090] If the response message corresponds to a payment result query message, then the payment status is determined based on the payment result query message.

[0091] Furthermore, the processor 1001 can call the data interaction program stored in the memory 1003 and also perform the following operations:

[0092] Obtain payment information, wherein the payment information is a payment code, order number, amount, or the payment information is an order number;

[0093] The payment information is encrypted into ciphertext data based on the communication key;

[0094] The signature value is determined based on the private key of the payment terminal;

[0095] The merchant information, the encrypted data, and the signature value are packaged into the payment message according to the payment message protocol between the payment terminal and the payment server.

[0096] Furthermore, the processor 1001 can call the data interaction program stored in the memory 1003 and also perform the following operations:

[0097] Invoke the security component;

[0098] After performing two-way authentication between the security component and the payment server, a communication key is negotiated with the payment server, and the validity period of the communication key is determined.

[0099] The communication key is associated with and stored in the payment terminal along with its validity period.

[0100] The digital yuan is compatible with traditional electronic payment methods, which is conducive to its promotion. QR code payment is an important form of electronic payment, and it has two modes: passive scanning and active scanning. In passive scanning, the merchant enters the payment amount on the POS terminal, which then scans the customer's payment code to complete the transaction. However, unlike traditional electronic payments, some acquiring banks do not allow POS terminals to directly initiate payment requests to their back-end systems when using digital yuan. Instead, they only allow digital yuan QR code payment requests to be initiated from servers with fixed public IP addresses.

[0101] This raises the following security issues: 1. Identity verification between the payment server and the payment terminal; 2. Data tampering prevention between the payment server and the payment terminal; 3. Communication link anomalies during payment collection; 4. How the payment server itself can prevent replay attacks; 5. How to store sensitive merchant information in the payment server.

[0102] Therefore, the aforementioned deficiencies exist in the relevant technologies. To address these deficiencies, this invention proposes a data interaction method applicable to a payment server, a security server, or a payment terminal. The aim is to improve the security of sensitive information during digital RMB payments by sending payment messages to the security server for security verification, ensuring that the payment server does not involve sensitive information.

[0103] The following explanation, through specific exemplary solutions, clarifies the scope of protection claimed in the claims of this invention, so that those skilled in the art can better understand the scope of protection of the claims. It is understood that the following exemplary solutions do not limit the scope of protection of this invention, but are only used to explain this invention.

[0104] For example, refer to Figure 2 In one embodiment of the data interaction method of the present invention, the data interaction method includes the following steps:

[0105] Step S1: Receive the payment message sent by the payment terminal and send the payment message to the security server;

[0106] In this embodiment, the entity that executes the data interaction method is the payment server.

[0107] The payment server is a server located between the payment terminal and the acquiring bank. Due to the payment regulations of some acquiring banks regarding digital RMB, the payment terminal cannot directly send payment requests to the acquiring bank. Therefore, the payment server sends payment requests to the acquiring bank through the payment server, which is deployed on the public network.

[0108] The payment server receives a payment message sent by the payment terminal. The payment message is a package of merchant information, encrypted data, and signature value by the payment terminal based on the payment message protocol between the payment terminal and the payment server. The payment server cannot view the specific content of the private information in the payment message. After receiving the payment message, it sends it to the security server.

[0109] Optionally, after receiving the payment message from the payment terminal, the payment server needs to check the integrity of the payment message, such as whether merchant information, encrypted data, signature value, etc. are missing. If they are missing, the server returns a message error to the payment terminal. The server also needs to check the timestamp. If the same message was received 200 milliseconds ago, the server replies that the system is busy to the payment terminal. If more than 10 minutes have passed, the server directly replies that the timeout has occurred to prevent duplicate payments.

[0110] Optionally, before step S1, the method further includes: invoking a security component; after performing two-way authentication with the payment terminal based on the security component, negotiating a communication key with the payment terminal and determining the validity period of the communication key; and sending the communication key and the validity period of the communication key to the security server.

[0111] Furthermore, both the payment terminal and the payment server can store security components. However, to enhance the security of these components, the payment server's security components can be stored on the security server itself. When two-way authentication is required, a communication connection is established with the security server, and the security components stored on the security server are invoked. The payment terminal is also configured with a pre-stored domain name of the payment server. The security components are the public key certificates of both the payment terminal and the payment server. The public key certificate is a customized two-way authentication protocol between the payment terminal and the payment server, which can be an SM2 public key certificate. After the payment terminal and the payment server complete two-way authentication based on the SM2 public key certificate, key negotiation is performed to verify the identities of both parties, thereby further improving the security of payment transactions.

[0112] The communication key can be determined based on the SM4 algorithm. The receiving terminal stores the negotiated SM4 communication key and its expiration time. The receiving server sends merchant information such as the front-end ID and merchant ID, along with the SM4 communication key and its expiration time, to the security server. It's understood that pre-stored security components such as the SM2 public key certificate and configured domain name are completed during the installation of the receiving terminal and receiving server devices. Two-way authentication and key negotiation are performed within a preset period, such as once a day, or when the receiving terminal receives a communication key error from the receiving server. SM2 and SM4 are Chinese national cryptographic algorithms. Two-way authentication is based on SM2, and the communication key is negotiated using the SM4 algorithm. These algorithms offer fast processing speed and high security, thus improving the speed and security of payment interactions.

[0113] Step S2: Upon receiving the payment ciphertext and acquiring bank address sent by the security server, a payment request is sent to the acquiring bank based on the payment ciphertext and acquiring bank address, so that the acquiring bank completes the payment operation corresponding to the payment request upon receiving the payment request, and sends a response message to the receiving server based on the payment operation;

[0114] In this embodiment, after the receiving server sends the payment message to the security server, it waits for the security server to complete security authentication. After successful authentication, the security server sends the acquiring bank's address URL and the encrypted payment message (which has been reprocessed by the security server). Upon receiving this, the receiving server sends a payment request to the acquiring bank based on the acquiring bank's address URL and the encrypted payment message, while simultaneously saving the encrypted payment message to its log. The acquiring bank is a port provided by the receiving bank, responsible for receiving payments and querying payment results. After receiving a payment request, the acquiring bank performs the receiving operation or queries the payment result, and sends a response message to the receiving server based on the payment operation result. The response message can be in plaintext, and its content can be directly viewed.

[0115] Step S3: Upon receiving the response message sent by the acquiring bank, forward the response message to the payment terminal.

[0116] In this embodiment, after receiving the response message, the payment server forwards the response message to the payment terminal and saves the response message to the log. After receiving the response message, the payment terminal views the content of the response message and completes subsequent operations based on the content of the response message.

[0117] Optionally, the payment message is a payment receipt message or a payment result query message. If the payment terminal needs to receive payment, the payment message is a payment receipt message, which involves payment information such as payment code, amount, and order number. Correspondingly, the payment request initiated by the payment server is a payment receipt request. If the payment terminal needs to query the payment result, the payment message is a payment result query message, which involves payment information such as order number. Correspondingly, the payment request initiated by the payment server is a payment result query request.

[0118] In the technical solution disclosed in this embodiment, the receiving server receives a payment message sent by the receiving terminal and forwards the payment message to the secure server. Upon receiving the payment ciphertext and the acquiring bank address, the server sends a payment request to the acquiring bank based on the payment ciphertext and the acquiring bank address. This enables the acquiring bank to complete the payment operation corresponding to the payment request upon receipt and send a response message to the receiving server based on the payment operation. Upon receiving the response message from the acquiring bank, the server forwards the response message to the receiving terminal. During the forwarding of the payment message and response message by the receiving server, no sensitive information is involved. This satisfies the requirement that payment requests cannot be directly sent from the receiving terminal to the acquiring bank, and also improves the security of sensitive information during the unified payment process.

[0119] Optionally, refer to Figure 3 In another embodiment of the data interaction method of the present invention, the data interaction method includes the following steps:

[0120] S10. Receive the payment message sent by the payment server and determine the merchant information based on the payment message;

[0121] In this embodiment, the entity executing the data interaction method is the security server.

[0122] The security server can be a software program or a server independent of the payment server. The security server connects to a database or has its own database, where all kinds of sensitive information and encrypted data are stored. For security reasons, the security server and its corresponding database are located on an intranet, and remote access is not allowed. The security server provides relevant interfaces. The payment server calls these interfaces to send payment messages to the security server. The security server performs security authentication operations such as splitting and assembling the payment message, decrypting and encrypting the encrypted data, and performing signature calculations. The security server receives payment messages from the payment server. These messages include merchant information, encrypted data, and a signature value. The security server can directly obtain merchant information from the payment message, including the merchant ID, payment terminal ID, and signature key.

[0123] S20. Obtain the communication key and the validity period of the communication key based on the merchant information;

[0124] S30. If the communication key is within the valid time, the payment message is decrypted using the communication key to obtain payment information;

[0125] In this embodiment, the security server queries the merchant table in the database based on the merchant information to obtain the communication key and its expiration time previously negotiated between the payment terminal and the payment server. If the expiration time has expired, a communication key expiration error is returned to the payment server. If the expiration time is still valid, the encrypted data in the payment message is decrypted using the communication key. The payment code, amount, and order number are obtained from the decrypted encrypted data. It should be noted that this data is encrypted on the payment server and cannot be viewed or modified. The security service checks the plaintext order number by checking if it exists in the order table of the database. If the order number exists, a duplicate order number error is returned to the payment server. If the order number does not exist, the order information is saved to the order table, and the corresponding payment status in the order table is saved as uncertain.

[0126] Optionally, before step S20, the signature value of the payment message can be verified to determine whether the payment message has been tampered with.

[0127] Specifically, the process involves obtaining a verification key based on the merchant information; determining the signature value of the receiving terminal based on the payment message; verifying the correctness of the signature value based on the verification key; and if the signature value is correct, proceeding to the step of obtaining the communication key and its validity period based on the merchant information. The verification key is a security key negotiated between the security server and the receiving terminal, used to verify that the signature content has been erroneous or tampered with. It corresponds to the receiving terminal's private key. The receiving terminal determines the signature value using its private key, and the security server verifies the correctness of the signature value using the verification key. The signature value is related to other content in the payment message. If other content has been tampered with, and the signature value calculated by the verification key is different from the signature value in the payment message, then the signature value is determined to be incorrect, and an error message is directly returned to the receiving server. If other content has not been tampered with, and the signature value calculated by the verification key is the same as the signature value in the payment message, then the signature value is determined to be correct, and the security server directly continues to execute step S20. This prevents message tampering.

[0128] S40. Obtain a security key based on the merchant information, reassemble the payment information based on the security key and the payment protocol with the acquiring bank to obtain payment plaintext, and determine payment ciphertext based on the security components provided by the acquiring bank and the payment plaintext;

[0129] In this embodiment, the security server can obtain a security key that is pre-stored in the database. The security key is a key provided to the merchant by the acquiring bank and is stored in the database in association with the merchant information. After retrieving the security key, the server reassembles the payment information according to the payment agreement with the acquiring bank to obtain plaintext data. Then, it calls the security component provided by the acquiring bank to encrypt the plaintext data to obtain payment ciphertext. This security component can be stored in the database or on the security server.

[0130] S50. Send the payment ciphertext and the acquiring bank address to the payment server.

[0131] In this embodiment, the secure server re-decrypts and re-encrypts the payment message using the signature key to obtain the payment ciphertext. Then, it obtains the address URL of the acquiring bank and sends the address and payment ciphertext to the receiving server. The receiving server then sends a payment request to the acquiring bank based on the received acquiring bank address and payment ciphertext.

[0132] In the technical solution disclosed in this embodiment, the secure server receives the payment message sent by the receiving server, encrypts the payment message according to the communication key, and then re-encrypts it according to the security key, payment protocol and security components related to the receiving bank to obtain the payment ciphertext, and feeds it back to the receiving server. The secure server is independent of the receiving server. The receiving server deployed on the public network cannot view or modify sensitive information. The secure server can further perform security verification on the payment message, which improves the security of sensitive information in the unified payment process.

[0133] Optionally, refer to Figure 3 Based on any of the above embodiments, in another embodiment of the data interaction method of the present invention, the data interaction method includes:

[0134] Step S100: Obtain payment information and determine the payment message based on the communication key negotiated with the payment server and the payment information;

[0135] In this embodiment, the entity executing the data interaction method is the payment terminal.

[0136] The payment terminal is a data interface provided to merchants by the payment service provider. It can be a POS terminal. The payment terminal can perform payment collection services and payment result query services. The corresponding payment messages include payment collection messages and payment result query messages. The acquiring bank's corresponding payment operations are payment collection and payment result query. During payment collection, the payment terminal sends a payment collection message to the payment service provider, which then sends a payment request (payment request) to the acquiring bank based on the payment collection message. During payment result query services, the payment terminal sends a payment result query message to the payment service provider, which then sends a payment request (payment result query request) to the acquiring bank based on the payment result query message. If, due to network disconnection or other reasons, the payment service provider cannot obtain a payment result from the acquiring bank, it needs to send a payment record with an uncertain status to the security server. The security server saves this payment record in its database. Simultaneously, the payment service provider replies with the uncertain status to the payment terminal. Upon receiving the notification of the uncertain payment status, the payment terminal needs to initiate the payment result query service again.

[0137] Optionally, the payment information is obtained, which may be a payment code, order number, amount, or the payment information may be an order number; the payment information is encrypted into ciphertext data according to the communication key; a signature value is determined according to the private key of the payment terminal; and the merchant information, the ciphertext data, and the signature value are packaged into a payment message according to the payment message protocol between the payment terminal and the payment server.

[0138] For example, the payment terminal can be equipped with a camera device. During the payment service, the payment amount is configured, the buyer's payment code is identified and obtained, and an order number is created. The payment information of the payment service includes the payment code, amount, and order number. The payment information is encrypted using the SM4 communication key negotiated with the payment server. The payment terminal's private key is used to perform a signature operation on the front-end ID, merchant ID, encrypted data, timestamp, and random number to obtain a signature value. This private key corresponds to the verification key obtained by the security server. The security server verifies the signature value to prevent the payment message from being tampered with. According to the payment message protocol between the payment terminal and the payment server, the payment message is composed of the front-end ID, merchant ID and other merchant information, encrypted data, timestamp, random number, and signature value in JSON format and sent to the payment server.

[0139] For example, when a payment terminal receives a response message corresponding to a payment message, it needs to query the payment result. The payment terminal obtains the order number based on the response message or other means. The payment information for querying the payment result service is the order number. The payment information is encrypted using the SM4 communication key negotiated with the payment server. The payment terminal uses its private key to perform a signature operation on the front-end ID, merchant ID, encrypted data, timestamp, and random number to obtain a signature value. This private key corresponds to the signature verification key obtained by the security server. The security server verifies the signature value to prevent the payment message from being tampered with. According to the payment message protocol between the payment terminal and the payment server, the payment terminal sends a JSON-formatted payment result query message composed of the front-end ID, merchant ID, other merchant information, encrypted data, timestamp, random number, and signature value to the payment server.

[0140] Optionally, before step S100, the method further includes: invoking a security component; after performing two-way authentication with the payment server based on the security component, negotiating a communication key with the payment server and determining the validity period of the communication key; and associating the communication key with the validity period of the communication key and storing it in the payment terminal. The payment terminal pre-stores the security component and is also configured with a pre-stored domain name of the payment server, used for communication, two-way authentication, and key negotiation with the payment server.

[0141] Step S200: Send a payment message to the payment server, wherein the payment message is a payment receipt message or a payment result query message;

[0142] In this embodiment, the payment terminal can perform payment collection services and payment result query services. Both services require sending payment messages to the payment service terminal. When payment collection services are needed, the terminal obtains the payment information corresponding to the payment collection service, generates a payment collection message and sends it to the payment service terminal. When payment results are needed, the terminal obtains the payment information corresponding to the payment result query and generates a payment result query message and sends it to the payment service terminal.

[0143] Step S300: When receiving the response message forwarded by the payment server, examine the response message;

[0144] In this embodiment, after the payment terminal sends the payment message to the payment server, it waits for the acquiring bank's response message forwarded by the payment server. The response message is in plaintext, and the payment terminal can directly determine the content of the response message.

[0145] Optionally, the payment status value is determined based on the response message. If the status value is greater than or equal to a preset threshold, such as 200, then the response message is determined to be a response message to the payment message.

[0146] Step S400: If the response message corresponds to a payment message, then send a payment result query message to the payment server according to the order number in the response message;

[0147] Step S500: If the response message corresponds to a payment result query message, then determine the payment status based on the payment result query message.

[0148] In this embodiment, if after reviewing the response message it is determined that the response message is the response message corresponding to the previously sent payment message, then the order number is obtained from the response message as payment information, and step S100 is executed, that is, a payment result query message is sent to the payment server.

[0149] If, after reviewing the response message, it is determined that the response message corresponds to the previously issued payment result query message, then the response message is checked. If the response message returns a payment status of success, then the payment is successful; if the payment result returned by the response message is uncertain, then a new payment result query request needs to be initiated.

[0150] Optionally, the payment terminal is equipped with a user interaction module to display the return information and current process from the payment server, as well as allow users to set payment amounts. In the event of an error, it can prompt for manual handling, thereby enhancing the convenience of the payment process.

[0151] To facilitate understanding, the following specific application scenario illustrates this solution:

[0152] Please refer to Figure 5 In this application scenario, there are a payment terminal, a payment server, a security server, a database, and an acquiring bank. The payment terminal initiates two-way authentication with the payment server based on the pre-stored public key certificate. The payment server calls the public key certificate stored on the security server to complete the two-way authentication with the payment server. After successful authentication, the payment terminal initiates key negotiation with the payment server based on the pre-stored public key certificate to determine the access key and its validity period. The payment terminal saves the access key and its validity period, and the payment server sends the communication key to the database service through the security server for storage.

[0153] The payment terminal sends a payment message (equivalent to a payment request) to the payment server. The payment message includes encrypted data (payment code, amount, order number), merchant information (front-end ID, merchant ID), signature value, timestamp, random number, etc. The payment server determines whether the payment message content is complete and checks the timestamp. If both are correct, it sends the message to the security server.

[0154] The secure server requests a signature verification key from the database based on the merchant information in the payment message. The secure server then verifies the signature value of the payment message using this key, checking for tampering. If the verification is successful, the secure server requests a communication key and its validity period from the database. If within the validity period, it decrypts the encrypted data of the payment message using this key, obtaining sensitive information such as the payment code, amount, and order number. The secure server checks the plaintext order number, verifying its existence in the database order table. If the order number does not exist, it saves the order information to the database order table. The payment status in the order table is saved as indeterminate. The secure server retrieves the security key provided by the acquiring bank to the merchant from the merchant table and assembles the plaintext data according to the acquiring bank's payment message protocol. It then calls the security component provided by the acquiring bank to obtain the payment ciphertext. The secure server returns the acquiring bank's URL and the payment ciphertext to the payment server.

[0155] The payment server initiates a payment request to the receiving bank based on the acquiring bank's address URL and payment encryption. After completing the payment operation, the receiving bank sends a response message to the payment server. The payment server receives the response message, saves it to its log, and then forwards it to the payment terminal.

[0156] When the payment terminal receives a response message from the payment server, it checks the payment status value. If the status value is 200, it means that the response message corresponds to the payment message. The payment terminal then needs to query the payment result of the order corresponding to the order number in the payment message. The payment terminal sends a payment result query message (equivalent to a payment result query request) to the payment server. The payment result query message includes encrypted data composed of the order number (order number), merchant information (front-end ID, merchant ID), signature value, timestamp, random number, etc.

[0157] After receiving the payment result query message, the receiving server operates in the same way as when receiving the payment message. After the acquiring bank completes the payment result query operation, it returns the corresponding response message. The acquiring bank forwards the response message to the receiving terminal. The receiving terminal checks the response message. If the response message returns a success status, the payment is successful. If the payment result returned by the response message is uncertain, it is necessary to re-initiate the payment result query message.

[0158] In the technical solution disclosed in this embodiment, the receiving terminal encrypts the payment information according to the communication key to obtain the payment message, and forwards it to the receiving server. Since the receiving server does not have the communication key, it cannot view or modify the payment message. The receiving terminal determines the signature value of the payment message according to the private key, which needs to be verified by the security server to prevent the payment message from being tampered with. In addition, the interaction between multiple terminals makes the way sensitive information is stored more diverse and difficult to find and modify. Therefore, based on the above embodiment, the security of digital RMB in the unified payment process can be improved.

[0159] Furthermore, embodiments of the present invention also propose a data interaction system, the data interaction system comprising:

[0160] Payment terminal, payment server, security server;

[0161] When the payment terminal executes, it implements the steps of the data interaction method described in the above embodiments; when the payment server executes, it implements the steps of the data interaction method described in the above embodiments; when the security server executes, it implements the steps of the data interaction method described in the above embodiments.

[0162] Furthermore, embodiments of the present invention also propose a computer-readable storage medium storing a data interaction program, which, when executed by a processor, implements the steps of the data interaction method described in the above embodiments.

[0163] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.

[0164] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0165] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause the payment terminal, payment server, or security server to execute the methods described in the various embodiments of the present invention.

[0166] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.

Claims

1. A data interaction method, characterized in that, Applied to the payment collection server, the data interaction method includes: The system receives a payment message from a payment terminal and sends it to a security server. The security server receives the payment message from the payment terminal and determines merchant information based on it. It then obtains a communication key and its validity period based on the merchant information. If the communication key is valid within the validity period, it decrypts the payment message using the communication key to obtain payment information. The communication key is a key negotiated and created during two-way authentication between the payment terminal and the payment server, along with its validity period. This key is stored on the security server for decrypting payment messages sent by the payment terminal, thereby improving the security of communication between the payment terminal and the payment server. The system also obtains a security key based on the merchant information, reassembles the payment information using the security key and the payment protocol with the acquiring bank to obtain plaintext, and determines ciphertext based on the security components provided by the acquiring bank and the plaintext. Finally, it sends the ciphertext and the acquiring bank's address to the payment server. Upon receiving the payment ciphertext and acquiring bank address sent by the secure server, a payment request is sent to the acquiring bank based on the payment ciphertext and acquiring bank address, so that the acquiring bank completes the payment operation corresponding to the payment request upon receiving the payment request, and sends a response message to the receiving server based on the payment operation; Upon receiving a response message from the acquiring bank, the bank forwards the response message to the payment terminal.

2. The data interaction method as described in claim 1, characterized in that, Before the step of receiving the payment message sent by the payment terminal and sending the payment message to the security server, the method further includes: Invoke the security component; After performing two-way authentication between the security component and the payment terminal, a communication key is negotiated with the payment terminal, and the validity period of the communication key is determined. The communication key and its validity period are sent to the security server.

3. The data interaction method as described in claim 1, characterized in that, The payment message is either a receipt message or a payment result query message.

4. A data interaction method, characterized in that, Applied to a security server, the data interaction method includes: Receive payment messages sent by the payment server and determine merchant information based on the payment messages; The communication key and the validity period of the communication key are obtained based on the merchant information. If the communication key is within its validity period, the payment message is decrypted using the communication key to obtain payment information. The communication key is a key and its validity period negotiated and created during two-way authentication between the payment terminal and the payment server. It is sent and stored on the security server for the security server to decrypt the payment message sent by the payment terminal, thereby improving the security of communication between the payment terminal and the payment server. The security key is obtained based on the merchant information. The payment information is reassembled based on the security key and the payment protocol with the acquiring bank to obtain the payment plaintext. The payment ciphertext is determined based on the security components provided by the acquiring bank and the payment plaintext. The payment ciphertext and the acquiring bank address are sent to the payment server.

5. The data interaction method as described in claim 4, characterized in that, Before the step of obtaining the communication key and the validity period of the communication key based on the merchant information, the method further includes: Obtain the signature verification key based on the merchant information; The signature value of the receiving terminal is determined based on the payment message; Determine whether the signature value is correct based on the verification key; If the signature value is correct, then the steps of obtaining the communication key and the validity period of the communication key based on the merchant information are performed.

6. A data interaction method, characterized in that, Applied to payment terminals, the data interaction method includes: Obtain payment information and determine the payment message based on the communication key negotiated with the payment server and the payment information; A payment message is sent to the payment server. This payment message can be a payment receipt message or a payment result query message. The payment server receives the payment message from the payment terminal and forwards it to a security server. The security server determines merchant information based on the payment message; it obtains a communication key and its validity period based on the merchant information; if the communication key is valid within the validity period, it decrypts the payment message using the communication key to obtain payment information. The communication key is a key negotiated and created during two-way authentication between the payment terminal and the payment server, along with its validity period. This key is sent and stored on the security server for decryption of payment messages sent by the payment terminal, thereby improving the security of communication between the payment terminal and the payment server. The payment service obtains a security key based on the merchant information, reassembles the payment information into plaintext based on the security key and the payment protocol with the acquiring bank, and determines ciphertext based on the security components provided by the acquiring bank and the plaintext. It then sends the ciphertext and the acquiring bank address to the payment server. Upon receiving the ciphertext and acquiring bank address from the security server, the payment server sends a payment request to the acquiring bank based on the ciphertext and acquiring bank address, enabling the acquiring bank to complete the payment operation corresponding to the payment request upon receipt and send a response message to the payment server based on the payment operation. Upon receiving the response message from the acquiring bank, the payment server forwards the response message to the payment terminal. When receiving the response message forwarded by the payment server, examine the response message; If the response message corresponds to a payment message, then a payment result query message is sent to the payment server based on the order number in the response message; If the response message corresponds to a payment result query message, then the payment status is determined based on the payment result query message.

7. The data interaction method as described in claim 6, characterized in that, The step of obtaining payment information and determining the payment message based on the communication key negotiated with the payment server and the payment information includes: Obtain payment information, wherein the payment information is a payment code, order number, amount, or the payment information is an order number; The payment information is encrypted into ciphertext data based on the communication key; The signature value is determined based on the private key of the payment terminal; The merchant information, the encrypted data, and the signature value are packaged into the payment message according to the payment message protocol between the payment terminal and the payment server.

8. The data interaction method as described in claim 6, characterized in that, Before the step of determining the payment message based on the communication key negotiated with the payment server and the payment information, the method further includes: Invoke the security component; After performing two-way authentication between the security component and the payment server, a communication key is negotiated with the payment server, and the validity period of the communication key is determined. The communication key is associated with and stored in the payment terminal along with its validity period.

9. A data interaction system, characterized in that, The data interaction system includes: a payment terminal, a payment server, and a security server; The payment terminal performs the steps of the data interaction method as described in any one of claims 6 to 8; The payment server performs the steps of the data interaction method as described in any one of claims 1 to 3; The secure server performs the steps of the data interaction method as described in any one of claims 4 to 5.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a data interaction program, which, when executed by a processor, implements the steps of the data interaction method as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Data transmitting method and system applied to cloud system

    CN102098317A

  • Payment processing method, device and system

    CN111192057A