WO2020223932A1 - 离线支付方法、装置、电子设备及存储介质 - Google Patents

离线支付方法、装置、电子设备及存储介质 Download PDF

Info

Publication number
WO2020223932A1
WO2020223932A1 PCT/CN2019/086042 CN2019086042W WO2020223932A1 WO 2020223932 A1 WO2020223932 A1 WO 2020223932A1 CN 2019086042 W CN2019086042 W CN 2019086042W WO 2020223932 A1 WO2020223932 A1 WO 2020223932A1
Authority
WO
WIPO (PCT)
Prior art keywords
payment
information
server
mobile terminal
direct connection
Prior art date
Application number
PCT/CN2019/086042
Other languages
English (en)
French (fr)
Inventor
方攀
陈岩
Original Assignee
深圳市欢太科技有限公司
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市欢太科技有限公司, Oppo广东移动通信有限公司 filed Critical 深圳市欢太科技有限公司
Priority to PCT/CN2019/086042 priority Critical patent/WO2020223932A1/zh
Priority to CN201980091192.2A priority patent/CN113383356B/zh
Publication of WO2020223932A1 publication Critical patent/WO2020223932A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/30Payment architectures, schemes or protocols characterised by the use of specific devices or networks
    • G06Q20/32Payment architectures, schemes or protocols characterised by the use of specific devices or networks using wireless devices

Definitions

  • This application relates to the field of payment technology, and more specifically, to an offline payment method, device, electronic equipment, and storage medium.
  • this application proposes an offline payment method, device, electronic equipment and storage medium to improve the above problems.
  • the embodiments of the present application provide an offline payment method, which is applied to a mobile terminal.
  • the method includes: in a payment state, determining whether the network of the mobile terminal is available; if the network is not available, based on short-range wireless communication technology Establish a direct connection with the payment device; after encrypting the payment account information, send it to the payment device through the direct connection to instruct the payment device to send the payment account information and the payment information to the server for deduction paragraph.
  • an embodiment of the present application provides an offline payment method, which is applied to a collection device, the method includes: entering an offline payment mode based on a preset trigger mode; establishing a direct connection with a mobile terminal based on short-range wireless communication technology ; Receive payment account information sent by the mobile terminal; send the payment account information and payment information to the server.
  • an embodiment of the present application provides an offline payment method applied to a server.
  • the method includes: receiving payment account information and payment information sent by a payment collection device, where the payment account information is Data encrypted by a public key; decrypt the payment account information by a first private key, wherein the first private key and the first public key are a key pair; according to the payment information and the decrypted Payment account information for deduction.
  • an embodiment of the present application provides an offline payment device applied to a mobile terminal.
  • the device includes: a network confirmation module for determining whether the network of the mobile terminal is available in the payment state; a direct connection module for If the network is unavailable, establish a direct connection with the collection device based on short-range wireless communication technology; the information sending module is used to encrypt the payment account information and send it to the collection device through the direct connection for instructions The collection device sends the payment account information and collection information to the server for deduction.
  • an embodiment of the present application provides an offline payment device, which is applied to a collection device, and the device includes: an activation module for entering an offline payment mode based on a preset trigger mode; a direct connection module for The short-range wireless communication technology establishes a direct connection with the mobile terminal; the information receiving module is used to receive payment account information sent by the mobile terminal; the information sending module is used to send the payment account information and the payment information to the server.
  • an embodiment of the present application provides an offline payment device applied to a server.
  • the device includes an information receiving module for receiving payment account information and payment information sent by a payment collection device, wherein the payment The account information is data encrypted by the first public key; the decryption module is used for decrypting the payment account information by the first private key, wherein the first private key and the first public key are a key pair ; Deduction module for deduction according to the payment information and the decrypted payment account information.
  • an embodiment of the present application provides an electronic device, including: one or more processors; a memory; one or more programs, wherein the one or more programs are stored in the memory and configured To be executed by the one or more processors, the one or more programs are configured to execute the above-mentioned methods.
  • an embodiment of the present application provides a computer-readable storage medium having program code stored in the computer-readable storage medium, and the program code can be invoked by a processor to execute the foregoing method.
  • the account information is sent to the payment device by establishing a direct connection with the payment device, through the payment device
  • the connection with the server is used for deduction, so that electronic payments can be made even when the mobile terminal is disconnected from the Internet.
  • Fig. 1 shows an interaction diagram of an offline payment system provided by an embodiment of the present application.
  • Fig. 2 shows a sequence state diagram of an offline payment method provided by an embodiment of the present application.
  • Fig. 3 shows a bluetooth data encapsulation structure diagram provided by an embodiment of the present application.
  • Fig. 4 shows a schematic diagram of a data packet format provided by an embodiment of the present application.
  • Fig. 5 shows a sequence state diagram of an offline payment method provided by another embodiment of the present application.
  • Fig. 6 shows another schematic diagram of a data packet format provided by an embodiment of the present application.
  • Fig. 7 shows another schematic diagram of a data packet format provided by an embodiment of the present application.
  • FIG. 8 shows a sequence state diagram of an offline payment method provided by another embodiment of the present application.
  • Fig. 9 shows a flowchart of an offline payment method applied to a mobile terminal according to an embodiment of the present application.
  • Fig. 10 shows a flowchart of an offline payment method applied to a payment collection device provided by an embodiment of the application.
  • Fig. 11 shows a flowchart of an offline payment method applied to a server according to an embodiment of the present application.
  • Fig. 12 shows a functional module diagram of an offline payment device applied to a mobile terminal according to an embodiment of the present application.
  • FIG. 13 shows a functional module diagram of an offline payment device applied to a payment collection device provided by an embodiment of the application.
  • Fig. 14 shows a functional module diagram of an offline payment device applied to a server provided by an embodiment of the present application.
  • Fig. 15 shows a structural block diagram of an electronic device provided by an embodiment of the present application.
  • Fig. 16 is a storage unit for storing or carrying program code for implementing the offline payment method according to the embodiment of the present application.
  • the receiving device of the payee is usually a fixed device, and can ensure a relatively stable wireless network connection or a wired network connection. Therefore, the inventor proposes a solution to use the payment collection device to forward the network data packets of the mobile phone, so that the mobile phone can complete the passive scan code payment without the network.
  • the inventor proposes the offline payment method, device, electronic device, and storage medium provided by the embodiments of the present application.
  • the payment state if it is determined that the network of the mobile terminal is unavailable, the payment will be The payment device establishes a direct connection, encrypts the account information and sends it to the payment device. Since the payment device has a relatively stable network connection and can interact with the server, the payment device can send the account information to the server for deduction. .
  • the offline payment method, device, electronic equipment, and storage medium provided in the embodiments of the present application can be applied to the offline payment system shown in FIG. 1.
  • the offline payment system includes a mobile terminal 101, a collection device 102, and a server 103.
  • the mobile terminal may be a smart device such as a mobile phone, a tablet computer, or a smart watch that can perform electronic payments.
  • the payment collection device is a smart device that can collect payments, such as a cash register, a computer, etc.
  • the server can be one server or a server cluster formed by multiple servers.
  • the embodiment of the present application takes a server as an example for description.
  • the mobile terminal when the network is available, the mobile terminal can connect to the server through the base station 104, or connect to the server through the hotspot 105, and exchange data with the server. That is, the mobile terminal can establish a connection with the server through a mobile data network or a wireless local area network.
  • the payment collection device 102 may also establish a network connection with the server through a mobile data network or a wireless local area network.
  • the mobile terminal and the collection device can establish a direct connection based on the short-range wireless communication technology, as shown in Figure 1.
  • the method applied to the offline payment system may include:
  • Step S110 In the payment state, the mobile terminal determines whether the network is available.
  • the payment status can be the opened state of the payment application, the opened state of the payment interface under the payment application (such as the payment QR code display page, the payment scan page), etc., as long as the mobile terminal is ready for electronic payment , Can be regarded as the payment status of the mobile terminal.
  • the mobile terminal When the mobile terminal is in the payment state, it determines whether the network is available.
  • the network may include a cellular network, that is, a mobile data network, and a wireless local area network.
  • the mobile terminal can interact with the server through the network.
  • the payment can be completed by data forwarding through the collection device.
  • the situation that the network is unavailable can be that the mobile terminal's network connection fails, that is, it has not successfully connected to WiFi and mobile data networks, etc.; the situation that the network connection is unavailable can also be that the mobile terminal is connected to the network, but the connected network Unable to send and receive data; the situation that the network connection is unavailable can also be that the mobile terminal is connected to the mobile data network, but the current traffic usage of the mobile data network account corresponding to the mobile terminal has exceeded the maximum usable threshold, which indicates the traffic After this threshold is exceeded, the mobile terminal can no longer use the mobile data network.
  • the method for determining the network status of the mobile terminal is not limited.
  • the network connection status and network connection type of the device can be monitored through ConnectivityManager; the change of network connection can be detected by registering and broadcasting BreadcastReceiver; and the change of network connection can be detected through PhoneStateListener. Monitor the network connection status and network connection type of the device.
  • Step S120 If the mobile terminal network is not available, the mobile terminal enters an offline payment mode.
  • Step S130 If the mobile terminal network is unavailable, the collection device enters an offline payment mode.
  • the mobile terminal needs to send the payment account information to the server through the payment collection device for deduction. Therefore, the mobile terminal can turn on the offline payment mode.
  • the collection device needs to receive the account information of the mobile terminal and forward it to the server, the collection device also needs to enter the offline payment mode accordingly.
  • the mobile terminal can enter the offline payment mode when it detects that the network is not available.
  • the manner in which the payment collection device enters the offline payment mode may be based on a preset trigger manner.
  • the preset trigger method may be an operation of the payment collection device by the payee corresponding to the payment device to make the payment device enter the offline payment mode; or the payment device scanning the payment QR code of the mobile terminal to receive payment Failure; or the payment receiving device scans the QR code provided by the mobile terminal to indicate that the network connection is disconnected; or the payment device scans the QR code provided by the mobile terminal to indicate the direct connection request, etc.
  • the two-dimensional code indicating the disconnection of the network connection and the two-dimensional code indicating the direct connection request may be the same two-dimensional code, or may be different two-dimensional codes.
  • the payment collection device in order to cooperate with the mobile terminal whose network connection is not available, the payment collection device may enter the offline payment mode, and the manner in which it enters the offline payment mode is not limited in the embodiment of the present application.
  • Step S140 Based on the short-range wireless communication technology, the mobile terminal establishes a direct connection with the payment collection device.
  • the mobile terminal and the collection device can establish a direct connection based on short-range wireless communication technology.
  • the direct connection means that the mobile terminal and the payment collection device are point-to-point connections, and there is no intermediate access point between each other.
  • the direct connection may be a Bluetooth connection, a WiFi direct connection, an NFC connection or others, which can realize data transmission between the mobile terminal and the payment device without relying on a data network.
  • the Bluetooth connection is mainly used as an example of direct connection for description.
  • the method of establishing a direct connection between the mobile terminal and the payment collection device may be that in the offline payment mode, the mobile terminal provides identification information for establishing a direct connection based on short-range wireless communication technology for use
  • the payment collection device establishes a direct connection based on the short-range wireless communication technology with the mobile terminal according to the identification information; correspondingly, the mobile terminal establishes a direct connection with the payment collection device.
  • the mobile terminal may generate a two-dimensional code including the coding information of the identification information, and the two-dimensional code indicates that the mobile terminal initiates a direct connection request to the payment collection device.
  • the identification information includes information that can be used to directly connect to the mobile terminal and identify the mobile terminal. For example, if the identification information can include the mac address and password used by the mobile terminal for direct connection, the collection device can obtain the mac address of the mobile terminal by scanning the QR code. According to the mac address and password, it can be compared with the mobile terminal. Establish a direct connection between.
  • the mobile terminal generates and displays a two-dimensional code containing its own Bluetooth mac address and a password value that needs to be used when establishing a Bluetooth connection, and the user provides the two-dimensional code to the payment device.
  • the receiving device After scanning the QR code, the receiving device obtains the Bluetooth mac address and password value of the mobile terminal, initiates a Bluetooth connection request to the mobile terminal based on the mac address and password value, and establishes a Bluetooth connection with the mobile terminal.
  • Step S150 After the mobile terminal encrypts the payment account information, it is sent to the payment device through the direct connection.
  • the payment account information used for payment is encrypted and sent to the collection device through the direct connection with the collection device.
  • the payment account information may be the information of the account logged in by the payment application in the mobile terminal, which may be specifically provided by the payment application; the payment account information may also be other account information stored in the mobile terminal that can be used for electronic payment .
  • the payment account information sent by the mobile terminal to the receiving device needs to be forwarded to the server by the receiving device. Therefore, the encryption method of the payment account information is a method in which the receiving device cannot decrypt but the server can decrypt it.
  • encryption and decryption can be performed by a key pair.
  • the server may have a key pair. After the public key in the key pair encrypts data, it can be decrypted by the private key.
  • the public key in the key pair is defined as the first public key, and the secret is defined
  • the private key in the key pair is the first private key.
  • the server holds the first private key, and sends the first public key to the mobile terminal for data encryption by the mobile terminal.
  • the mobile terminal can obtain the first public key provided by the server from the server, and store the first public key.
  • the mobile terminal When in the offline payment mode, the payment account information needs to be forwarded to the server through the payment device, the mobile terminal may encrypt the payment account information through the first public key, and then send it to the receiver through the direct connection. Section equipment.
  • the mobile terminal may encapsulate the payment account information into a data packet and send it to the payment collection device.
  • the destination address of the header in the data packet is encapsulated as the address of the server. Since the mobile terminal has no network connection, the source address of the header in the data packet is encapsulated as empty for the receiving device to receive the address of the server. When sending data packets, fill in the source address as the address of the receiving device.
  • the address of the server is the address of the server that performs the deduction processing, and represents the server that the payment account information needs to reach.
  • the mobile terminal is connected to the payment device Bluetooth in the offline payment mode.
  • the payment account information is encrypted by the first public key, it is encapsulated into an IP data packet by the payment application, and then the IP data packet is sent to the Bluetooth module.
  • the module uses the Bluetooth Network Encapsulation Protocol (BNEP, Bluetooth Network Encapsulation Protocol) to encapsulate the IP data packet, as shown in Figure 3, and sends it to the receiving device through the Bluetooth connection.
  • BNEP Bluetooth Network Encapsulation Protocol
  • IP represents an IP data packet
  • IP header represents the head of an IP data packet.
  • L2CAP and SDP are basic Bluetooth protocols, so I will not repeat them here.
  • Step S160 The payment receiving device receives the payment account information sent by the mobile terminal.
  • the payment collection device receives the payment account information sent by the mobile terminal directly connected to it through the direct connection.
  • the payment device decapsulates the data packet to obtain the encrypted payment account information.
  • the collection device can also obtain the server address in the data packet.
  • the mobile terminal is connected to the receiving device Bluetooth, and the Bluetooth module of the receiving device receives the IP data packet encapsulated by the BNEP protocol, it will decapsulate the IP data packet and send the IP data packet to the corresponding receiving device.
  • the payment processing unit extracts the encrypted payment account information in the IP data packet from the payment processing unit.
  • Step S170 The payment receiving device sends the payment account information and payment information to the server.
  • the collection device sends the encrypted payment account information and its own collection information to the server, where the collection information may include the amount to be paid, the account information of the payee, etc.
  • the payment collection device may encapsulate the payment account information and the payment information into a new data packet and send it to the server through the payment processing unit.
  • the address of the receiving device is used as the source address of the header of the data packet
  • the address of the server is used as the destination address of the header.
  • the encapsulated data packet can be an IP data packet.
  • the format is shown in Figure 4.
  • the IP header represents the header of the encapsulated IP data packet.
  • the address of the server may be the destination address encapsulated in the data packet sent by the mobile terminal; optionally, the address of the server may also be determined by the collection device according to the correspondingly connected server for collection.
  • the source address is the address of the receiving device
  • the destination address encapsulation can be the address of the server obtained from the unencapsulated data packet.
  • Step S180 The server performs deduction according to the payment account information and the payment information sent by the payment device.
  • the server can determine the account to be deducted according to the payment account information sent by the collection device; determine the amount of deduction and the account of the collection according to the collection information, thereby completing the deduction operation.
  • the server may decapsulate the data packet sent by the payment device to obtain payment account information, where the payment account information is data encrypted by the first public key.
  • the server decrypts the payment account information through the first private key, and can obtain the decrypted payment account information.
  • the server may deduct the payment after the user confirms the payment.
  • the server before the server performs deduction according to the payment account information and the payment information sent by the payment collection device, it may further include:
  • Step S171 The server encrypts the payment information with the second public key and sends it to the payment device.
  • the mobile terminal may hold a key pair, define the public key in the key pair as the second public key, and define the private key in the key pair as the second private key.
  • the mobile terminal may send the second public key to the server when the network is available, and the server stores the second public key.
  • the server encrypts the collection information with the second public key and sends it to the collection device.
  • the collection information may include the collection account information and the collection amount.
  • the server may encapsulate the data sent to the payment device into a data packet, and the destination address of the header of the data packet is the address of the payment device.
  • the address can be obtained according to the payment device that completely sends the data, or according to Obtain the source address in the data packet sent by the receiving device to the server.
  • the source address of the header of the data packet is the address of the server itself.
  • Fig. 6 shows a schematic diagram of the format of the IP data packet encapsulated by the server.
  • a timeout period may also be included, which is used to inform the mobile terminal that the user confirmation time cannot exceed the timeout period.
  • Step S172 The payment receiving device receives the payment information sent by the server.
  • Step S173 The payment collection device sends the payment information to the mobile terminal through the direct connection.
  • the collection device After receiving the data sent by the server, the collection device forwards the data to the mobile terminal.
  • the encapsulation form of the data forwarded by the payment collection device to the mobile terminal is consistent with the connection mode between the payment collection device and the mobile terminal.
  • the receiving device after receiving the data packet sent by the server, the receiving device sends the data packet to the Bluetooth module of the machine.
  • the Bluetooth module uses the BNEP protocol to encapsulate the data packet and forwards it to the mobile terminal via Bluetooth.
  • Step S174 The mobile terminal receives and displays the payment information sent by the server to the payment device and forwarded by the payment device via the direct connection.
  • the mobile terminal receives the data forwarded by the payment collection device, obtains the payment information, and displays the payment information for user confirmation.
  • the mobile terminal receives the payment information sent by the server to the payment device that is forwarded by the payment device through a direct connection, and the payment information is data encrypted by a second public key;
  • the receipt information is decrypted and displayed according to the decrypted receipt information for user confirmation.
  • the data included in the data sent by the server includes not only the collection information, but also includes a timeout time, the mobile terminal can obtain the timeout time after decrypting the data.
  • the Bluetooth module of the mobile terminal receives a data packet encapsulated by the BNEP protocol, and sends the data packet to the payment application of the machine.
  • the payment application decrypts the data packet with the second private key to obtain the payment.
  • the server encapsulates the sent data such as information and timeout time and displays it.
  • the mobile terminal when it displays, it can display the receiving account information so that the user can confirm the payee; it can display the received amount so that the user can confirm whether the amount to be deducted is correct.
  • the data sent by the server also includes a timeout period, and the timeout period can also be displayed to remind the user to confirm the displayed payment information before the timeout period.
  • Step S175 If the mobile terminal receives a confirmation operation on the payment information, it feeds back confirmation information to the payment device through the direct connection.
  • the mobile terminal displays the payment information for user confirmation. If the user confirms that the payment information is correct, the confirmation operation can be performed.
  • the mobile terminal receives the confirmation operation of the payment information, it can feed back confirmation information to the payment device through a direct connection.
  • the confirmation information indicates that the user has triggered the operation of confirming that the payment information is correct on the mobile terminal for use by the payment device
  • the forwarding instructs the server to deduct the payment according to the confirmation information.
  • the mobile terminal in order to prevent a Man-in-the-MiddleAttack (MITM attack), if the mobile terminal receives a confirmation operation on the payment information, it records the time stamp of the confirmation operation. If the time stamp does not exceed the timeout time, the mobile terminal may send the time stamp and the confirmation information to the payment device through the direct connection, so as to instruct the server according to the time through the forwarding of the payment device. Check whether the confirmation information is valid.
  • MITM attack Man-in-the-MiddleAttack
  • the mobile terminal may send the timestamp and the confirmation information to the payment device through the direct connection for use in forwarding instructions through the payment device
  • the server judges whether the confirmation information is valid according to the timestamp. Where the time stamp exceeds the timeout time, it means that the trigger time of the user confirmation operation exceeds the timeout time, and the confirmation information is invalid.
  • the mobile terminal may feed back the identification information that confirms that the information is invalid to the server, so that when the server receives the confirmation information fed back by the payment device, the identification information that confirms the information is invalid, Confirm that the confirmation message is invalid over time.
  • the mobile terminal may encrypt the confirmation information and/or the timestamp with the first public key, and then send the confirmation information to the payment device through the direct connection, so that the confirmation information can be verified by the payment device.
  • the forwarding indicates that the server decrypts the confirmation information through the first private key.
  • the mobile terminal can encapsulate the encrypted information into a data packet and send it to the Bluetooth module of the machine, which is encapsulated by the Bluetooth module using the BNEP protocol and then sent to the collection device through the Bluetooth connection.
  • the data packet may be an IP data packet, and its format may be the data format shown in FIG. 7.
  • Step S176 The payment receiving device forwards the confirmation information to the server.
  • the receiving device receives the confirmation information sent by the mobile terminal and sends it to the server.
  • the mobile terminal sends a time stamp
  • the collection device also receives the time stamp and sends it to the server.
  • the Bluetooth module of the payment receiving device decapsulates the data packet therein, and sends the data packet to the payment processing unit.
  • the payment processing unit forwards the data packet to the server through the network connection with the server.
  • Step S177 The server receives the confirmation information sent by the payment receiving device. If the confirmation information is valid, execute the step S180.
  • the server receives the data sent by the collection device and obtains the confirmation information. If the confirmation information is valid, it indicates that the user corresponding to the payment account confirms the payment, and the payment account corresponding to the payment account information is deducted from the payment account corresponding to the payment amount in the payment information.
  • the payment account information may be data encrypted by the first public key, and the server decrypts the payment account information by the first private key.
  • the server can also obtain the time stamp after decryption.
  • the server receives the data packet sent by the payment device, decrypts the data packet with the first private key, and obtains the confirmation information therein. If the data packet sent by the receiving device includes a time stamp, the server obtains the time stamp at the same time. The server determines whether the time stamp exceeds the timeout period. If it does not exceed the timeout period, it indicates that the user's confirmation operation does not exceed the timeout period. The confirmation information is valid, and the server deducts the payment account corresponding to the payment account information.
  • the server does not deduct the payment account corresponding to the payment account information.
  • the payment failure can be reported to the payment collection device and the mobile terminal.
  • the server does not deduct the payment account corresponding to the payment account information. paragraph.
  • the server after the server has successfully deducted the money, it can also feed back the result of the deduction to the collection device and the mobile terminal.
  • the data sent to the payment collection device to notify the payment collection device of the deduction information may include the deduction amount, the name of the payer, and the like.
  • the receiving device displays the result after receiving the deduction.
  • the deduction result sent to the mobile terminal can be encrypted by the second public key and encapsulated into a data packet, and sent to the payment device, and the payment device forwards the data packet to the mobile terminal through a direct connection.
  • the mobile terminal decrypts the data packet through the second private key, obtains the deduction result therein, and displays it.
  • the deduction result sent to the mobile terminal may include data such as the deduction amount and the name of the payee's account.
  • the display of the mobile terminal can be realized through a payment application.
  • the server may feed back a deduction result to the collection device, and the deduction result may include the deduction amount and the recipient information, and the second public key is not used to encrypt.
  • the collection device receives the deduction result, displays the deduction amount and other information therein, and sends the deduction result to the mobile terminal through a direct connection.
  • the mobile terminal displays the deduction result after receiving it.
  • the payment account information is forwarded to the server through the payment device, and the payment device sends the payment information to the server at the same time, and the server is based on the payment information sent by the payment device. Payment information and forwarded payment account information for deduction.
  • Fig. 8 shows the interaction relationship between the mobile terminal, the payment collection device and the server in a specific embodiment.
  • the offline payment method provided in this embodiment uses a Bluetooth connection as a direct connection between the mobile terminal and the collection device for illustration.
  • the offline payment method includes:
  • Step S201 When the network of the mobile terminal is available, the server sends the first public key to the mobile terminal and holds the first private key; the mobile terminal sends the second public key to the server and holds the second private key.
  • Step S202 In the payment state, determine whether the network of the mobile terminal is available.
  • Step S203 If the network is not available, the mobile terminal enters an offline payment mode.
  • Step S204 The mobile terminal provides a two-dimensional code including identification information.
  • the identification information includes a Bluetooth mac address and a password value required to establish a Bluetooth connection.
  • Step S205 The payment collection device scans the QR code.
  • Step S206 The payment receiving device establishes a Bluetooth connection with the mobile terminal according to the identification information obtained by scanning the QR code.
  • Step S207 The mobile terminal encrypts the payment account information using the first public key and encapsulates it into an IP data packet.
  • Step S208 The mobile terminal encapsulates the IP data packet using the BNEP protocol, and sends it to the collection device via Bluetooth.
  • Step S209 The payment receiving device decapsulates the IP data packet, extracts the encrypted payment account information, and encapsulates the payment information and the encrypted payment account information together into a new IP data packet.
  • Step S210 The receiving device sends the IP data packet to the server through the network connection.
  • Step S211 The server obtains the payment information and the payment account information from the IP data packet sent by the payment device, and decrypts the payment account information through the first private key.
  • Step S212 The server encrypts the collection information and the timeout period by using the second public key, and encapsulates it into an IP data packet.
  • Step S213 The server sends the IP data packet to the collection device.
  • Step S214 After the receiving device encapsulates the IP data packet through the BNEP protocol, it is forwarded to the mobile terminal through the Bluetooth connection.
  • Step S215 The mobile terminal decapsulates the IP data packet, and uses the second private key to decrypt the payment information and the timeout time therein, and display it.
  • Step S216 The mobile terminal receives the user's confirmation operation, and records the time stamp information of the confirmation operation.
  • Step S217 The mobile terminal encrypts the confirmation information and the time stamp information corresponding to the confirmation operation using the first public key, and then encapsulates them into an IP data packet.
  • Step S218 After the mobile terminal encapsulates the IP data packet using the BNEP protocol, it is sent to the collection device via the Bluetooth connection.
  • Step S219 The receiving device decapsulates to obtain an IP data packet.
  • Step S220 The receiving device forwards the IP data packet to the server.
  • Step S221 The server decrypts the confirmation information and the time stamp information in the data packet by using the first private key. If it is determined that the confirmation information is valid according to the time stamp information, the payment is deducted according to the payment account information and the payment information.
  • Step S222 Encapsulate the deduction result into an IP data packet and send it to the collection device.
  • Step S223 The payment receiving device displays the payment result according to the deduction result.
  • Step S224 The receiving device sends the IP data packet to the mobile terminal via the Bluetooth connection.
  • Step S225 The mobile terminal obtains the deduction result from the IP data packet and displays it.
  • the embodiment of the present application also provides an offline payment method, which is applied to a mobile terminal. See Figure 9, the method includes:
  • Step S310 In the payment state, determine whether the network of the mobile terminal is available.
  • Step S320 If the network is not available, establish a direct connection with the collection device based on the short-range wireless communication technology.
  • Step S330 After the payment account information is encrypted, it is sent to the payment device through the direct connection, so as to instruct the payment device to send the payment account information and the payment information to the server for deduction.
  • the mobile terminal determines whether the network is available, so as to select different payment strategies according to whether the network is available or unavailable.
  • the mobile terminal normally communicates with the server through the available mobile data network or wireless local area network to make payment.
  • a direct connection is established with the collection device based on the short-range wireless communication technology, so that the payment account information is sent to the server for payment through the forwarding of the collection device.
  • the mobile terminal encrypts the payment account information and sends it to the payment device through a direct connection to instruct the payment device to forward the payment account information to the server for payment, so as to implement electronic payment on the mobile terminal when no network is available.
  • the embodiment of the present application also provides an offline payment method, which is applied to a collection device. As shown in Figure 10, the method includes:
  • Step S410 Enter the offline payment mode based on the preset trigger mode.
  • Step S420 Establish a direct connection with the mobile terminal based on the short-range wireless communication technology.
  • Step S430 Receive payment account information sent by the mobile terminal.
  • Step S440 Send the payment account information and the payment information to the server.
  • the payment collection device can have a preset trigger method when it enters the offline payment mode.
  • the payment device receives the preset trigger method, it means that a mobile terminal needs to make a payment when no network is available, and the collection device establishes a direct connection with the mobile terminal.
  • the payment collection device receives the payment account information sent by the mobile terminal through the direct connection, and sends the payment account information together with the payment information to the server, and the server deducts the payment to realize the electronic payment of the mobile terminal when there is no network available. .
  • the embodiment of the present application also provides an offline payment method, which is applied to a server. As shown in Figure 11, the method includes:
  • Step S510 Receive payment account information and payment information sent by the payment collection device, where the payment account information is data encrypted by the first public key.
  • Step S520 Decrypt the payment account information using a first private key, where the first private key and the first public key are a key pair.
  • Step S530 Perform deduction according to the payment information and the decrypted payment account information.
  • the payment account information and collection information received by the server are sent by the collection device.
  • the payment account information sent by the mobile terminal to the payment collection device for forwarding may be encrypted by the first public key.
  • the server decrypts the payment account information through the first private key, so that the payment account information is only available to the server.
  • the server performs deduction according to the payment information and the decrypted payment account information, so as to realize the electronic payment of the mobile terminal in the state where no network is available.
  • the embodiment of the present application also provides an offline payment device 600, which is applied to a mobile terminal.
  • the device 600 includes: a network confirmation module 610, used to determine whether the mobile terminal's network is available in the payment state; a direct connection module 620, if the network is not available, based on short-range wireless communication technology and receiving The payment device establishes a direct connection; the information sending module 630 is configured to encrypt the payment account information and send it to the payment device through the direct connection, so as to instruct the payment device to send the payment account information and the payment information Send to the server for deduction.
  • the information sending module 630 may be used to encrypt the payment account information with the first public key, and then send it to the payment device through the direct connection, so as to instruct the payment device to send The payment account information and the payment information are sent to the server for deduction, and the server is instructed to decrypt the payment account information through the first private key through the forwarding of the payment device, wherein the mobile terminal stores the The first public key obtained from the server when the network is available, and the first public key and the first private key are a key pair.
  • the information sending module 630 is configured to encrypt the payment account information with the first public key, and then send the payment account information to the payment device through the direct connection, which may include: After being encrypted by the first public key, it is encapsulated into a data packet, wherein the destination address of the header in the data packet is encapsulated as the address of the server, and the source address is encapsulated as empty; the data packet is encapsulated through the direct connection Sent to the collection device.
  • the apparatus 600 may further include an information receiving module 640, configured to receive and display the payment information sent by the server to the payment device and forwarded by the payment device through the direct connection.
  • the information sending module 630 may also be used to, if a confirmation operation on the payment information is received, feedback confirmation information to the payment device through the direct connection, so as to instruct the payment device to send the confirmation information Forward to the server.
  • the information receiving module 640 may be configured to receive payment information sent by the server to the payment device and forwarded by the payment device through the direct connection, where the payment information is data encrypted by a second public key ,
  • the second public key is sent to the server by the mobile terminal when the network is available;
  • the receipt information is decrypted by the second private key, wherein the second public key and the second private key are a key pair;
  • the decrypted payment information is displayed for user confirmation
  • the information sending module 630 is configured to feed back confirmation information to the payment collection device, which may include recording the time stamp of the confirmation operation if a confirmation operation to the payment information is received; combining the time stamp and The confirmation information is sent to the payment collection device through the direct connection, so that the forwarding instruction server of the payment collection device determines whether the confirmation information is valid according to the time stamp.
  • the information sending module 630 may be configured to encrypt the confirmation information through the first public key, and then send it to the payment device through the direct connection, so as to be used for the payment of the confirmation information through the payment device.
  • the forwarding of the confirmation information instructs the server to decrypt the confirmation information through the first private key.
  • the direct connection module 620 may be used to provide identification information for establishing a direct connection based on short-range wireless communication technology, so that the payment collection device can establish a short-range wireless communication based on the identification information with the mobile terminal. Establishing a direct connection with communication technology; establishing a direct connection with the collection device.
  • the direct connection module 620 is configured to provide identification information for direct connection based on the short-range wireless communication technology, and may include: generating a two-dimensional code including the coding information of the identification information.
  • the embodiment of the present application also provides an offline payment device 700, which is applied to a collection device.
  • the device 700 includes: an activation module 710, used to enter an offline payment mode based on a preset trigger mode; a direct connection module 720, used to establish a direct connection with a mobile terminal based on short-range wireless communication technology; an information receiving module 730, configured to receive payment account information sent by the mobile terminal; an information sending module 740, configured to send the payment account information and payment information to the server.
  • the information sending module 740 may be used to decapsulate the data packet to obtain the address of the server and encrypted payment account information; after encapsulating the encrypted payment account information and the payment information into a data packet Sent to the server, wherein the destination address in the data packet is encapsulated as the address of the server obtained from the de-encapsulated data packet, and the source address is the address of the payment device.
  • the device may further include another information receiving module for receiving payment information sent by the server; another information sending module for sending the payment information to the mobile terminal through the direct connection , Used to instruct the mobile terminal to confirm.
  • the embodiment of the present application also provides an offline payment device 800, which is applied to a server.
  • the apparatus 800 includes: an information receiving module 810 for receiving payment account information and payment information sent by a payment collection device, wherein the payment account information is data encrypted by a first public key; a decryption module 820, used to decrypt the payment account information by using the first private key, where the first private key and the first public key are a key pair; the deduction module 830 is used to decipher the payment information and The decrypted payment account information is deducted.
  • the apparatus 800 may further include a confirmation module, which is used to encrypt the payment information with a second public key and send it to the payment device to instruct the payment device to encrypt the The payment information is forwarded to the mobile terminal; the confirmation information sent by the payment device is received. If the confirmation information is valid, the deduction module 830 is configured to deduct the payment according to the payment information and the decrypted payment account information.
  • a confirmation module which is used to encrypt the payment information with a second public key and send it to the payment device to instruct the payment device to encrypt the The payment information is forwarded to the mobile terminal; the confirmation information sent by the payment device is received. If the confirmation information is valid, the deduction module 830 is configured to deduct the payment according to the payment information and the decrypted payment account information.
  • the collection device when the mobile terminal is in the payment state, if there is no network connection, the collection device can be used as a relay, and the payment account information can be forwarded to the server through the collection device.
  • the server performs deduction according to the collection information sent by the collection device and the payment account information forwarded by the collection device, so as to realize electronic payment when the mobile terminal has no network connection.
  • the coupling between the modules may be electrical, mechanical or other forms of coupling.
  • each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist alone physically, or two or more modules may be integrated into one module.
  • the above-mentioned integrated modules can be implemented in the form of hardware or software functional modules.
  • FIG. 15 shows a structural block diagram of an electronic device 900 according to an embodiment of the present application.
  • the electronic device 900 may be a mobile terminal, a payment collection device or a server.
  • the electronic device includes one or more processors 910 (only one is shown in the figure), a memory 920 and one or more programs.
  • the one or more programs are stored in the memory 920 and configured to be executed by the one or more processors 910.
  • the one or more programs are configured to execute the methods described in the foregoing embodiments.
  • the processor 910 may include one or more processing cores.
  • the processor 910 uses various interfaces and lines to connect various parts of the entire electronic device 900, and executes by running or executing instructions, programs, code sets, or instruction sets stored in the memory 920, and calling data stored in the memory 920.
  • the processor 910 may adopt at least one of digital signal processing (Digital Signal Processing, DSP), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA), and Programmable Logic Array (Programmable Logic Array, PLA).
  • DSP Digital Signal Processing
  • FPGA Field-Programmable Gate Array
  • PLA Programmable Logic Array
  • the processor 910 can integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), a modem, and the like.
  • the memory 920 may include random access memory (RAM) or read-only memory (Read-Only Memory).
  • the memory 920 may be used to store instructions, programs, codes, code sets or instruction sets.
  • the memory 920 may include a storage program area and a storage data area, where the storage program area may store instructions for implementing an operating system, instructions for implementing at least one function, instructions for implementing each of the foregoing method embodiments, and the like.
  • the data storage area can also store data created by the server in use.
  • FIG. 16 shows a structural block diagram of a computer-readable storage medium provided by an embodiment of the present application.
  • the computer-readable storage medium 940 stores program code, and the program code can be invoked by a processor to execute the method described in the foregoing method embodiment.
  • the computer-readable storage medium 940 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read Only Memory), EPROM, hard disk, or ROM.
  • the computer-readable storage medium 940 includes a non-transitory computer-readable storage medium.
  • the computer-readable storage medium 940 has a storage space for executing the program code 941 of any method step in the above method. These program codes can be read out from or written into one or more computer program products.
  • the program code 941 may be compressed in an appropriate form, for example.

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Accounting & Taxation (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

本申请公开了一种离线支付方法、装置、电子设备及存储介质,涉及支付技术领域。其中,应用于移动终端的方法包括:在支付状态下,确定移动终端的网络是否可用;若网络不可用,基于短距离无线通信技术与收款设备建立直接连接;将付款账户信息加密后,通过所述直接连接发送给所述收款设备,以用于指示收款设备将所述付款账户信息以及收款信息发送到服务器进行扣款,从而在移动终端断网时也可以进行电子支付。

Description

离线支付方法、装置、电子设备及存储介质 技术领域
本申请涉及支付技术领域,更具体地,涉及一种离线支付方法、装置、电子设备及存储介质。
背景技术
在移动支付领域,通过移动终端进行电子支付已经变得越来越普遍。但是,通过移动终端进行电子支付,对网络的依赖性强,一旦移动终端断网,则支付无法进行。
发明内容
鉴于上述问题,本申请提出了一种离线支付方法、装置、电子设备及存储介质,以改善上述问题。
第一方面,本申请实施例提供了一种离线支付方法,应用于移动终端,所述方法包括:在支付状态下,确定移动终端的网络是否可用;若网络不可用,基于短距离无线通信技术与收款设备建立直接连接;将付款账户信息加密后,通过所述直接连接发送给所述收款设备,以用于指示收款设备将所述付款账户信息以及收款信息发送到服务器进行扣款。
第二方面,本申请实施例提供了一种离线支付方法,应用于收款设备,所述方法包括:基于预设触发方式,进入离线支付模式;基于短距离无线通信技术与移动终端建立直接连接;接收移动终端发送的付款账户信息;将所述付款账户信息以及收款信息发送到服务器。
第三方面,本申请实施例提供了一种离线支付方法,应用于服务器,所述方法包括:接收收款设备发送的付款账户信息以及收款信息,其中,所述付款账户信息为通过第一公钥加密的数据;通过第一私钥对所述付款账户信息解密,其中,所述第一私钥与所述第一公钥为一个密钥对;根据收款信息以及解密后的所述付款账户信息进行扣款。
第四方面,本申请实施例提供了一种离线支付装置,应用于移动终端,所述装置包括:网络确认模块,用于在支付状态下,确定移动终端的网络是否可用;直连模块,用于若网络不可用,基于短距离无线通信技术与收款设备建立直接连接;信息发送模块,用于将付款账户信息加密后,通过所述直接连接发送给所述收款设备,以用于指示收款设备将所述付款账户信息以及收款信息发送到服务器进行扣款。
第五方面,本申请实施例提供了一种离线支付装置,应用于收款设备,所述装置包括:启动模块,用于基于预设触发方式,进入离线支付模式;直连模块,用于基于短距离无线通信技术与移动终端建立直接连接;信息接收模块,用于接收移动终端发送的付款账户信 息;信息发送模块,用于将所述付款账户信息以及收款信息发送到服务器。
第六方面,本申请实施例提供了一种离线支付装置,应用于服务器,所述装置包括:信息接收模块,用于接收收款设备发送的付款账户信息以及收款信息,其中,所述付款账户信息为通过第一公钥加密的数据;解密模块,用于通过第一私钥对所述付款账户信息解密,其中,所述第一私钥与所述第一公钥为一个密钥对;扣款模块,用于根据收款信息以及解密后的所述付款账户信息进行扣款。
第七方面,本申请实施例提供了一种电子设备,包括:一个或多个处理器;存储器;一个或多个程序,其中所述一个或多个程序被存储在所述存储器中并被配置为由所述一个或多个处理器执行,所述一个或多个程序配置用于执行上述的方法。
第八方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有程序代码,所述程序代码可被处理器调用执行上述的方法。
本申请实施例提供的离线支付方法、装置、电子设备及存储介质,在移动终端网络不可用的情况下,通过与收款设备建立直接连接,将账户信息发送到收款设备,通过收款设备与服务器的连接进行扣款,从而在移动终端断网时也可以进行电子支付。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1示出了本申请实施例提供的离线支付系统的交互图。
图2示出了本申请一实施例提供的离线支付方法的时序状态图。
图3示出了本申请实施例提供的蓝牙数据封装结构图。
图4示出了本申请实施例提供的数据包格式的一种示意图。
图5示出了本申请另一实施例提供的离线支付方法的时序状态图。
图6示出了本申请实施例提供的数据包格式的另一种示意图。
图7示出了本申请实施例提供的数据包格式的又一种示意图。
图8示出了本申请又一实施例提供的离线支付方法的时序状态图。
图9示出了本申请实施例提供的应用于移动终端的离线支付方法的流程图。
图10示出了本申请实施例提供的应用于收款设备的离线支付方法的流程图。
图11示出了本申请实施例提供的应用于服务器的离线支付方法的流程图。
图12示出了本申请实施例提供的应用于移动终端的离线支付装置的功能模块图。
图13示出了本申请实施例提供的应用于收款设备的离线支付装置的功能模块图。
图14示出了本申请实施例提供的应用于服务器的离线支付装置的功能模块图。
图15示出了本申请实施例提供的电子设备的结构框图。
图16是本申请实施例的用于保存或者携带实现根据本申请实施例的离线支付方法的程序代码的存储单元。
具体实施方式
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附 图,对本申请实施例中的技术方案进行清楚、完整地描述。
随着移动支付技术的发展,通过移动终端进行电子支付已经变得越来越普遍。在通过移动终端进行电子支付时,必须保证移动终端网络正常,才能完成支付。然而,在实际场景中,移动终端的网络状态并不能保证正常,通常网络连接不稳定或者网络连接失败,导致网络连接不可用,无法与服务器进行数据交互。例如,在人流量比较大的商场中,蜂窝网络或者无线局域网往往负载很大,手机移动数据网络可能不可用,扫码支付无法进行。
发明人通过研究发现,在电子支付场景下,收款方的收款设备通常为固定设备,并且能保证较为稳定的无线网络连接或者有线网络连接。因此,发明人提出了一种使用收款设备转发手机的网络数据包,使手机能够在无网络条件下完成被动扫码支付的解决方式。
具体的,为了克服上述的各种缺点,发明人提出了本申请实施例提供的离线支付方法、装置、电子设备及存储介质,在支付状态下,若确定移动终端的网络不可用,则与收款设备建立直接连接,将账户信息加密后发送到收款设备,由于收款设备具有较为稳定的网络连接,可以与服务器进行数据交互,因此可以由收款设备将账户信息发送到服务器进行扣款。
本申请实施例提供的离线支付方法、装置、电子设备及存储介质可以应用于如图1所示的离线支付系统。如图1所示,该离线支付系统中包括移动终端101、收款设备102以及服务器103。其中,移动终端可以是手机、平板电脑、智能手表等可以进行电子支付的智能设备。收款设备是可以进行收款的智能设备,如收银机、电脑等,该服务器可以是一个服务器或者多个服务器形成的服务器集群,本申请实施例以一个服务器为例进行说明。
请参见图1,移动终端在网络可用的状态下,可以通过基站104连接服务器,或者通过热点105连接服务器,与服务器进行数据交互。即移动终端可以通过移动数据网络或者无线局域网与服务器建立连接。收款设备102也可以通过移动数据网络或者无线局域网与服务器建立网络连接。另外,移动终端在收款设备的一定距离范围内时,移动终端与收款设备可以基于短距离无线通信技术建立直接连接,如图1所示。请参见图2,应用于该离线支付系统的方法可以包括:
步骤S110:移动终端在支付状态下,确定网络是否可用。
当需要通过移动终端进行电子支付时,用户会操作控制移动终端进入支付状态。其中,该支付状态可以是支付应用程序打开的状态,支付应用程序下支付界面打开的状态(如支付二维码显示页面,支付扫描页面)等,只要移动终端为电子支付而做出准备的状态,都可以认为是移动终端的支付状态。
移动终端在支付状态下时,确定网络是否可用。该网络可以包括蜂窝网络,即移动数据网络,以及无线局域网等,移动终端在网络可用的状态下,可以通过网络和服务器进行数据交互。
而若移动终端在支付状态下时网络不可用,则可以通过收款设备进行数据转发完成支付。
可选的,网络不可用的情况可以是,移动终端网络连接失败,即没有成功连接到WiFi以及移动数据网络等;网络连接不可用的情况也可以是,移动终端连接网络,但是所连接 的网络无法进行数据收发;网络连接不可用的情况也可以是,移动终端连接的为移动数据网络,但是移动终端对应的移动数据网络账户当前的流量使用已超出可使用的最高阈值,该最高阈值表示流量超出这一阈值后,移动终端不可再使用移动数据网络。
在本申请实施例中,确定移动终端网络状态的方法并不限定,例如可以通过ConnectivityManager来监控设备的网络连接状态和网络连接类型;可以通过注册广播BreadcastReceiver来检测网络连接的变化;可以通过PhoneStateListener来监控设备的网络的连接状态和网络连接类型等。
步骤S120:若移动终端网络不可用,移动终端进入离线支付模式。
步骤S130:若移动终端网络不可用,收款设备进入离线支付模式。
若确定移动终端的网络不可用,则移动终端需要通过收款设备将付款账户信息发送到服务器进行扣款,因此,移动终端可以开启离线支付模式。对应的,由于收款设备需要接收移动终端的账户信息并转发到服务器,因此,收款设备也需要对应进入离线支付模式。
其中,移动终端可以在检测到网络不可用时,进入离线支付模式。
收款设备进入离线支付模式的方式可以是基于预设触发方式。其中,该预设的触发方式可以是,收款设备对应的收款人员对收款设备进行的使收款设备进入离线支付模式的操作;或者收款设备扫描移动终端的付款二维码收款失败;或者收款设备扫描到移动终端提供的用于表示网络连接断开的二维码;或者收款设备扫描到移动终端提供的用于表示直接连接请求的二维码等。其中,该表示网络连接断开的二维码与该表示直接连接请求的二维码可以是同一个二维码,也可以是不同的二维码。在本申请实施例中,为了配合网络连接不可用的移动终端,收款设备可以进入离线支付模式,且其进入离线支付模式的方式在本申请实施例中并不限定。
步骤S140:基于短距离无线通信技术,移动终端与收款设备建立直接连接。
在离线支付模式下,移动终端与收款设备可以基于短距离无线通信技术建立直接连接。该直接连接表示移动终端与收款设备之间为点对点连接,彼此之间没有中间接入点。在本申请实施例中,该直接连接可以是蓝牙连接,WiFi直连,NFC连接或者其他,可以实现不依赖数据网络并在移动终端与收款设备之间传输数据即可。在本申请实施例中,主要以蓝牙连接作为直接连接举例进行说明。
在本申请实施例中,移动终端与收款设备之间建立直接连接的方式可以是,在离线支付模式下,移动终端提供用于基于短距离无线通信技术建立直接连接的识别信息,以用于所述收款设备根据所述识别信息与所述移动终端建立基于短距离无线通信技术的建立直接连接;对应的,移动终端与所述收款设备建立直接连接。
具体的,移动终端可以生成包括所述识别信息的编码信息的二维码,该二维码表示移动终端向收款设备发起直接连接请求。该识别信息中包括的为可以用于直接连接到移动终端的、对移动终端进行识别的信息。例如,如该识别信息可以包括移动终端用于直接连接的mac地址以及密码,收款设备通过扫描该二维码,则可以获得移动终端的mac地址,根 据该mac地址以及密码,与移动终端之间建立直接连接。
如,移动终端生成包含自身蓝牙mac地址和建立蓝牙连接时需要使用的密码值的二维码并显示,用户将该二维码提供给收款设备。收款设备扫描该二维码后获得移动终端的蓝牙mac地址以及密码值,基于该mac地址以及密码值向移动终端发起蓝牙连接请求,并与移动终端建立蓝牙连接。
步骤S150:移动终端将付款账户信息加密后,通过所述直接连接发送给所述收款设备。
移动终端与收款设备建立直接连接后,将用于付款的付款账户信息加密后,通过与收款设备之间的直接连接,发送到收款设备。其中,该付款账户信息可以是移动终端中支付应用程序所登录的账户的信息,可以具体由支付应用程序提供;该付款账户信息也可以是移动终端中保存的其他可以用于电子支付的账户信息。
移动终端发送给收款设备的付款账户信息,需要收款设备转发到服务器,因此,对付款账户信息的加密方式为收款设备无法解密而服务器可以解密的方式。
在本申请实施例中,可以通过密钥对进行加密与解密。具体的,服务器可以具有一个密钥对,该密钥对中的公钥对数据进行加密后,通过私钥可以进行解密,定义该密钥对中的公钥为第一公钥,定义该密钥对中的私钥为第一私钥,服务器持有第一私钥,将第一公钥发送给移动终端用于移动终端进行数据加密。移动终端在网络可用时,可以从服务器获取服务器提供的第一公钥,并将第一公钥进行存储。
当在离线支付模式下,需要将付款账户信息通过收款设备转发到服务器时,移动终端可以将所述付款账户信息通过所述第一公钥加密后,通过所述直接连接发送给所述收款设备。
在本申请实施例中,移动终端可以将付款账户信息封装成数据包发送给收款设备。具体的,该数据包中的头部目的地址封装为所述服务器的地址,由于移动终端无网络连接,该数据包中的头部源地址封装为空,以用于收款设备在收到该数据包时,将源地址填写为收款设备的地址。其中,该服务器的地址为进行扣款处理的服务器的地址,表示付款账户信息需要到达的服务器。
例如,移动终端在离线支付模式下与付款设备蓝牙连接,将付款账户信息通过第一公钥加密后,通过支付应用程序封装成IP数据包,再将该IP数据包发送给蓝牙模块,由蓝牙模块使用蓝牙网络封装协议(BNEP,Bluetooth Network Encapsulation Protocol)封装IP数据包,如图3所示,并通过蓝牙连接发送给收款设备。图3中,IP表示IP数据包,IP头表示IP数据包的头部,L2CAP以及SDP是蓝牙基础性协议,在此不进行赘述。
步骤S160:收款设备接收移动终端发送的付款账户信息。
收款设备接收与其直接连接的移动终端通过该直接连接发送的付款账户信息。
其中,当移动终端将付款账户信息封装成数据包后发送到收款设备,收款设备对所述数据包解封装,获取其中加密的付款账户信息。另外,收款设备还可以获取数据包中的服 务器地址。
另外,若移动终端与收款设备蓝牙连接,收款设备的蓝牙模块接收到的为BNEP协议封装的IP数据包,则解封装出其中的IP数据包,并将IP数据包发送给相应的收款处理单元,由收款处理单元提取出IP数据包中加密的付款账户信息。
步骤S170:收款设备将所述付款账户信息以及收款信息发送到服务器。
收款设备将加密的付款账户信息与自身的收款信息发送到服务器,其中,收款信息可以包括待付款的金额,收款方的账户信息等。
具体的,收款设备可以通过收款处理单元,将付款账户信息以及收款信息封装为新的数据包后发送到服务器。其中,封装时,将收款设备的地址作为数据包头部源地址,将服务器的地址作为头部目的地址,封装成的数据包可以为IP数据包,格式如图4所示,图4中,IP头表示封装成的IP数据包的头部。可选的,该服务器的地址可以是移动终端发送的数据包中封装的目的地址;可选的,该服务器的地址也可以是收款设备根据对应连接的进行收款的服务器确定。
也就是说,收款设备将付款账户信息以及收款信息封装成的数据包中,源地址为收款设备的地址,目的地址封装可以为从解封装的数据包中获得的服务器的地址。
步骤S180:服务器根据收款设备发送的付款账户信息以及收款信息进行扣款。
服务器可以根据收款设备发送的付款账户信息,确定要扣款的账户;根据收款信息确定扣款金额以及收款的账户,从而可以完成扣款操作。
具体的,服务器可以从收款设备发送的数据包中解封装获得付款账户信息,该付款账户信息为通过第一公钥加密的数据。服务器通过第一私钥对该付款账户信息解密,可以获得解密后的付款账户信息。
进一步的,为了保证支付的安全性,防止付款终端发送的收款账户信息并未获得用户的支付允许,服务器可以在用户确认支付的情况下再进行扣款。
具体的,如图5所示,在本申请实施例中,服务器在根据收款设备发送的付款账户信息以及收款信息进行扣款之前,还可以包括:
步骤S171:服务器将收款信息通过第二公钥进行加密,并发送给所述收款设备。
移动终端可以持有一个密钥对,定义该密钥对中的公钥为第二公钥,定义该密钥对中的私钥为第二私钥。移动终端在网络可用时可以将第二公钥发送到服务器,服务器对该第二公钥存储。
服务器将收款信息通过第二公钥加密后发送到收款设备。该收款信息可以包括收款账户信息以及收款额等。
具体的,服务器可以将发送给收款设备的数据封装为数据包,该数据包的头部目的地址为收款设备的地址,该地址可以根据向完全发送数据的收款设备获取,也可以根据收款设备发送到服务器的数据包中的源地址获取。该数据包的头部源地址为服务器自身的地址。如图6示出了服务器封装的IP数据包的格式的一种示意图。
可选的,在发送给收款设备的数据中,如图6所示,还可以包括超时时间,用于告知移动终端用户确认的时间不能超过该超时时间。
步骤S172:收款设备接收服务器发送的收款信息。
步骤S173:收款设备将所述收款信息通过所述直接连接发送到所述移动终端。
收款设备接收到服务器发送的数据后,将该数据转发给移动终端。
其中,收款设备向移动终端转发的数据的封装形式契合于收款设备与移动终端之间的连接方式。例如,收款设备接收到服务器发送的数据包后,将该数据包发送给本机的蓝牙模块,蓝牙模块使用BNEP协议对该数据包进行封装,并通过蓝牙转发给移动终端。
步骤S174:移动终端接收所述收款设备通过所述直接连接转发的由服务器发送到收款设备的收款信息,并显示。
移动终端接收收款设备转发的数据,获得收款信息,将该收款信息显示以用于用户确认。
具体的,移动终端接收所述收款设备通过直接连接转发的由服务器发送到收款设备的收款信息,该收款信息为通过第二公钥加密的数据;通过第二私钥对所述收款信息解密,并根据解密后的收款信息显示,用于用户确认。当然,可以理解的,服务器发送的数据中所包括的数据若不止收款信息,如还包括超时时间,则移动终端对该数据解密后还可以获得超时时间。
例如,移动终端的蓝牙模块接收到BNEP协议封装的数据包,将该数据包发送给本机的支付应用程序,由支付应用程序通过第二私钥对该数据包进行解密,获得其中的收款信息以及超时时间等服务器封装发送的数据,并进行显示。
具体的,移动终端显示时,可以显示收款账户信息,以使用户确认收款方;可以显示收款金额,以使用户确认将要扣款的数额是否正确。另外,可选的,在服务器发送的数据中还包括超时时间,还可以对该超时时间进行显示,提醒用户在超时时间前对显示的收款信息进行确认。
步骤S175:移动终端若接收到对所述收款信息的确认操作,通过所述直接连接向所述收款设备反馈确认信息。
移动终端显示收款信息用于用户确认。若用户确认收款信息无误,则可以进行确认操作。
移动终端若接收到对收款信息的确认操作,可以通过直接连接向收款设备反馈确认信息,该确认信息表示用户在移动终端触发了确认收款信息无误的操作,以用于通过收款设备的转发指示服务器根据所述确认信息进行扣款。
可选的,为了防止中间人攻击(Man-in-the-MiddleAttack,MITM攻击),移动终端若接收到对所述收款信息的确认操作,记录所述确认操作的时间戳。若该时间戳没有超过超时时间,移动终端可以将所述时间戳以及所述确认信息通过所述直接连接发送到所述收款设备,以用于通过收款设备的转发指示服务器根据所述时间戳判断所述确认信息是否有效。
若该时间戳超过超时时间,作为一种实施方式,移动终端可以将所述时间戳以及所述确认信息通过所述直接连接发送到所述收款设备,以用于通过收款设备的转发指示服务器根据所述时间戳判断所述确认信息是否有效。其中,时间戳超过超时时间,表示用户确认操作的触发时间超过超时时间,该确认信息无效。
若该时间戳超过超时时间,作为另一种实施方式,移动终端可以向服务器反馈确认信息无效的标识信息,以使服务器接收到收款设备反馈的确认信息时,通过确认信息无效的标识信息,确定该确认信息超时无效。
具体的,移动终端可以将确认信息和/或时间戳通过第一公钥进行加密后,通过所述直接连接发送给所述收款设备,以用于通过所述收款设备对所述确认信息的转发,指示服务器通过第一私钥对所述确认信息进行解密。其中,移动终端可以将加密后的信息封装成数据包并发送给本机的蓝牙模块,由蓝牙模块使用BNEP协议封装后通过蓝牙连接发送到收款设备。如图7所示,该数据包可以为IP数据包,其格式可以是如图7所示的数据格式。
步骤S176:所述收款设备将所述确认信息转发给所述服务器。
收款设备接收移动终端发送的确认信息,并发送给服务器。当然,若移动终端发送有时间戳,则收款设备也接收该时间戳并发送给服务器。
具体的,收款设备的蓝牙模块接收到BNEP协议封装的数据包后,解封装出其中的数据包,并将该数据包发送给收款处理单元。收款处理单元将该数据包通过与服务器之间的网络连接转发给服务器。
步骤S177:服务器接收收款设备发送的确认信息。若所述确认信息有效,执行所述步骤S180。
服务器接收收款设备发送的数据,获得确认信息。若该确认信息有效,说明付款账户对应的用户确定支付,对付款账户信息对应的付款账户扣除收款信息中收款金额对应的金额。
其中,所述付款账户信息可以为通过第一公钥加密的数据,服务器通过第一私钥对所述付款账户信息解密。当然,若收款设备转发的数据中还包括时间戳,则服务器解密后还可以获得时间戳。
具体的,服务器接收到收款设备发送的数据包,对该数据包通过第一私钥进行解密,获得其中的确认信息。若收款设备发送的数据包中包括时间戳,服务器同时获得时间戳。服务器判断该时间戳是否超过超时时间,若未超过,表明用户进行确认操作的时间没有超过超时时间,该确认信息有效,服务器对付款账户信息对应的付款账户进行扣款。
若时间戳超出超时时间,数据包中的确认信息无效,服务器不对付款账户信息对应的付款账户进行扣款。对应的,可以向收款设备以及移动终端反馈扣款失败。
可选的,若由收款设备转发的数据包中不包括时间戳,但包括表示确认信息无效的标识信息,则判定数据包中的确认信息无效,服务器不对付款账户信息对应的付款账户进行扣款。
进一步的,在本申请实施例中,当服务器扣款成功后,还可以向收款设备以及移动终端反馈扣款结果。
作为一种实施方式,对于发送给收款设备,用于通知收款设备扣款信息的数据中,可以包括扣款金额,付款方名称等。收款设备接收到扣款结果后进行显示。对于发送给移动终端的扣款结果,可以通过第二公钥进行加密后封装为数据包,发送到收款设备,收款设备将该数据包通过直接连接转发给移动终端。移动终端通过第二私钥解密数据包,获取其 中的扣款结果并显示。其中,发送给移动终端的扣款结果,可以包括扣款金额,收款方账户名称等数据。移动终端的显示可以通过支付应用程序实现。
作为另一种实施方式,服务器可以向收款设备反馈一个扣款结果,该扣款结果可以包括扣款数额以及收款方信息,并且不通过第二公钥对进行加密。收款设备接收到扣款结果,显示其中的扣款数额等信息,并且将扣款结果通过直接连接发送给移动终端。移动终端接收到扣款结果后进行显示。
在本申请实施例中,在支付状态下,若移动终端无网络可用,通过收款设备转发付款账户信息到服务器,并且收款设备同时向服务器发送收款信息,服务器根据收款设备发送的收款信息以及转发的付款账户信息进行扣款。
如图8示出了在一种具体的实施例中移动终端、收款设备以及服务器的交互关系。请参见图8,该实施例提供的离线支付方法以蓝牙连接作为移动终端与收款设备之间的直接连接进行说明,该离线支付方法包括:
步骤S201:在移动终端的网络可用时,服务器向移动终端发送第一公钥,并持有第一私钥;移动终端向服务器发送第二公钥,并持有第二私钥。
步骤S202:在支付状态下,确定移动终端的网络是否可用。
步骤S203:移动终端若网络不可用,进入离线支付模式。
步骤S204:移动终端提供包括识别信息的二维码,该识别信息包括蓝牙mac地址以及建立蓝牙连接时需要的密码值。
步骤S205:收款设备扫描该二维码。
步骤S206:收款设备根据扫描二维码获得的识别信息与移动终端建立蓝牙连接。
步骤S207:移动终端使用第一公钥将付款账户信息加密,封装成IP数据包。
步骤S208:移动终端使用BNEP协议封装该IP数据包,并通过蓝牙发送到收款设备。
步骤S209:收款设备解封装出IP数据包,提取出已加密的付款账户信息,将收款信息以及该已加密的付款账户信息一起封装成新的IP数据包。
步骤S210:收款设备将IP数据包通过网络连接发送给服务器。
步骤S211:服务器从收款设备发送的IP数据包中获取收款信息以及付款账户信息,并通过第一私钥对付款账户信息解密。
步骤S212:服务器通过第二公钥对收款信息以及超时时间进行加密,并封装成IP数据包。
步骤S213:服务器将IP数据包发送给收款设备。
步骤S214:收款设备将该IP数据包通过BNEP协议封装后,通过蓝牙连接转发给移动终端。
步骤S215:移动终端解封装出IP数据包,并使用第二私钥对其中的收款信息以及超时时间进行解密,并显示。
步骤S216:移动终端接收用户的确认操作,并记录确认操作的时间戳信息。
步骤S217:移动终端将确认操作对应的确认信息以及时间戳信息使用第一公钥进行加密后,封装成IP数据包。
步骤S218:移动终端使用BNEP协议封装该IP数据包后,通过蓝牙连接发送到收款设备。
步骤S219:收款设备解封装获得IP数据包。
步骤S220:收款设备将IP数据包转发给服务器。
步骤S221:服务器通过第一私钥对数据包中的确认信息以及时间戳信息进行解密。若根据时间戳信息确定该确认信息有效,根据付款账户信息以及收款信息进行扣款。
步骤S222:将扣款结果封装成IP数据包后发送给收款设备。
步骤S223:收款设备根据扣款结果进行显示。
步骤S224:收款设备将该IP数据包通过蓝牙连接发送给移动终端。
步骤S225:移动终端从IP数据包中获取扣款结果并显示。
本申请实施例中各个步骤的具体执行可以参照前述实施例,本申请实施例不再进行赘述。
本申请实施例还提供了一种离线支付方法,该方法应用于移动终端。请参见图9,该方法包括:
步骤S310:在支付状态下,确定移动终端的网络是否可用。
步骤S320:若网络不可用,基于短距离无线通信技术与收款设备建立直接连接。
步骤S330:将付款账户信息加密后,通过所述直接连接发送给所述收款设备,以用于指示收款设备将所述付款账户信息以及收款信息发送到服务器进行扣款。
移动终端在支付状态下,确定网络是否可用,以根据网络可用或者不可用选择不同的支付策略。
若网络可用,则移动终端通过可用的移动数据网络或者无线局域网络正常和服务器进行通信,进行支付。
若移动终端的网络不可用,则基于短距离无线通信技术与收款设备建立直接连接,以通过收款设备的转发将付款账户信息发送到服务器进行支付。具体的,移动终端将付款账户信息加密后,通过直接连接发送到收款设备,以指示收款设备将该付款账户信息转发到服务器进行支付,实现移动终端在无网络可用的状态下的电子支付。
本申请实施例中移动终端所执行的各个步骤具体可参照前述实施例,在此不再进行赘 述。
本申请实施例还提供了一种离线支付方法,应用于收款设备。如图10所示,该方法包括:
步骤S410:基于预设触发方式,进入离线支付模式。
步骤S420:基于短距离无线通信技术与移动终端建立直接连接。
步骤S430:接收移动终端发送的付款账户信息。
步骤S440:将所述付款账户信息以及收款信息发送到服务器。
当移动终端在支付状态下无网络可用,则需要收款设备配合,开启离线支付模式下完成支付。收款设备进入离线支付模式可以有预设触发方式,当收款设备接收到预设触发方式,表示有移动终端需要在无网络可用的情况下进行支付,收款设备与移动终端建立直接连接。
收款设备接收移动终端通过该直接连接发送的付款账户信息,并将该付款账户信息与收款信息一起发送到服务器,由服务器进行扣款,实现移动终端在无网络可用的状态下的电子支付。
本申请实施例中收款设备所执行的各个步骤具体可参照前述实施例,在此不再进行赘述。
本申请实施例还提供了一种离线支付方法,应用于服务器。如图11所示,该方法包括:
步骤S510:接收收款设备发送的付款账户信息以及收款信息,其中,所述付款账户信息为通过第一公钥加密的数据。
步骤S520:通过第一私钥对所述付款账户信息解密,其中,所述第一私钥与所述第一公钥为一个密钥对。
步骤S530:根据收款信息以及解密后的所述付款账户信息进行扣款。
在离线支付模式下,服务器接收到的付款账户信息以及收款信息均由收款设备发送。为了保证数据的安全性,由移动终端发送到收款设备进行转发的付款账户信息可以通过第一公钥进行加密。则服务器通过第一私钥对付款账户信息解密,从而使付款账户信息仅为服务器可获知。
服务器根据收款信息以及解密出的付款账户信息进行扣款,实现移动终端在无网络可用的状态下的电子支付。
本申请实施例还提供了一种离线支付装置600,应用于移动终端。请参见图12,该装置600包括:网络确认模块610,用于在支付状态下,确定移动终端的网络是否可用;直连模块620,用于若网络不可用,基于短距离无线通信技术与收款设备建立直接连接;信息发送模块630,用于将付款账户信息加密后,通过所述直接连接发送给所述收款设备,以用于指示收款设备将所述付款账户信息以及收款信息发送到服务器进行扣款。
其中,可选的,信息发送模块630可以用于将所述付款账户信息通过所述第一公钥加密后,通过所述直接连接发送给所述收款设备,以用于指示收款设备将所述付款账户信息以及收款信息发送到服务器进行扣款,并通过所述收款设备的转发指示所述服务器通过第一私钥解密所述付款账户信息,其中,所述移动终端存储有在网络可用时从服务器获取的第一公钥,所述第一公钥与第一私钥为一个密钥对。
可选的,信息发送模块630用于将所述付款账户信息通过所述第一公钥加密后,通过所述直接连接发送给所述收款设备,可以包括:用于将所述付款账户信息通过所述第一公钥加密后,封装成数据包,其中所述数据包中的头部目的地址封装为所述服务器的地址,源地址封装为空;将所述数据包通过所述直接连接发送给所述收款设备。
可选的,该装置600还可以包括信息接收模块640,用于接收所述收款设备通过所述直接连接转发的由服务器发送到收款设备的收款信息,并显示。信息发送模块630还可以用于若接收到对所述收款信息的确认操作,通过所述直接连接向所述收款设备反馈确认信息,以用于指示所述收款设备将所述确认信息转发给所述服务器。
可选的,信息接收模块640可以用于接收所述收款设备通过所述直接连接转发的由服务器发送到收款设备的收款信息,所述收款信息为通过第二公钥加密的数据,该第二公钥由移动终端在网络可用时发送到服务器;通过第二私钥对所述收款信息解密,其中,所述第二公钥与第二私钥为一个密钥对;根据解密后的收款信息显示,用于用户确认
可选的,信息发送模块630用于向所述收款设备反馈确认信息,可以包括若接收到对所述收款信息的确认操作,记录所述确认操作的时间戳;将所述时间戳以及所述确认信息通过所述直接连接发送到所述收款设备,以用于通过收款设备的转发指示服务器根据所述时间戳判断所述确认信息是否有效。
可选的,信息发送模块630可以用于通过第一公钥对所述确认信息进行加密后,通过所述直接连接发送给所述收款设备,以用于通过所述收款设备对所述确认信息的转发,指示服务器通过第一私钥对所述确认信息进行解密。
可选的,直连模块620可以用于提供用于基于短距离无线通信技术建立直接连接的识别信息,以用于所述收款设备根据所述识别信息与所述移动终端建立基于短距离无线通信技术的建立直接连接;与所述收款设备建立直接连接。
可选的,直连模块620用于提供用于基于短距离无线通信技术直接连接的识别信息,可以包括:生成包括所述识别信息的编码信息的二维码。
本申请实施例还提供了一种离线支付装置700,应用于收款设备。请参见图13,该装置700包括:启动模块710,用于基于预设触发方式,进入离线支付模式;直连模块720,用于基于短距离无线通信技术与移动终端建立直接连接;信息接收模块730,用于接收移动终端发送的付款账户信息;信息发送模块740,用于将所述付款账户信息以及收款信息发送到服务器。
可选的,信息发送模块740可以用于对所述数据包解封装,获取其中服务器的地址以 及加密的付款账户信息;将所述加密的付款账户信息与所述收款信息封装为数据包后发送到服务器,其中,该数据包中的目的地址封装为从解封装的数据包中获得的所述服务器的地址,源地址为所述收款设备的地址。
可选的,该装置还可以包括另一信息接收模块,用于接收服务器发送的收款信息;另一信息发送模块,用于将所述收款信息通过所述直接连接发送到所述移动终端,用于指示所述移动终端进行确认。
本申请实施例还提供了一种离线支付装置800,应用于服务器。请参见图14,该装置800包括:信息接收模块810,用于接收收款设备发送的付款账户信息以及收款信息,其中,所述付款账户信息为通过第一公钥加密的数据;解密模块820,用于通过第一私钥对所述付款账户信息解密,其中,所述第一私钥与所述第一公钥为一个密钥对;扣款模块830,用于根据收款信息以及解密后的所述付款账户信息进行扣款。
可选的,该装置800还可以包括确认模块,用于将所述收款信息通过第二公钥进行加密,并发送给所述收款设备,以用于指示所述收款设备将加密后的收款信息转发给移动终端;接收收款设备发送的确认信息。若确认信息有效,则扣款模块830,用于根据收款信息以及解密后的所述付款账户信息进行扣款。
在本申请实施例中,移动终端在支付状态下,若无网络连接,则可以将收款设备作为一个中继,通过收款设备将付款账户信息转发到服务器。服务器根据收款设备发送的收款信息以及收款设备转发的付款账户信息进行扣款,实现移动终端无网络连接时的电子支付。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述的各个方法实施例之间可以相互参照;每个方法实施例中各个实施方式之间也可以相互参照。上述描述装置和模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,模块相互之间的耦合可以是电性,机械或其它形式的耦合。
另外,在本申请各个实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。
请参考图15,其示出了本申请实施例提供的一种电子设备900的结构框图。该电子设备900可以是移动终端,收款设备或者服务器。该电子设备包括一个或多个处理器910(图中仅示出一个),存储器920以及一个或多个程序。其中,所述一个或多个程序被存储在所述存储器920中,并被配置为由所述一个或多个处理器910执行。所述一个或多个程序配置用于执行前述实施例所描述的方法。
处理器910可以包括一个或者多个处理核。处理器910利用各种接口和线路连接整个电子设备900内的各个部分,通过运行或执行存储在存储器920内的指令、程序、代码集或指令集,以及调用存储在存储器920内的数据,执行电子设备900的各种功能和处理数据。可选地,处理器910可以采用数字信号处理(Digital Signal Processing, DSP)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、可编程逻辑阵列(Programmable Logic Array,PLA)中的至少一种硬件形式来实现。处理器910可集成中央处理器(Central Processing Unit,CPU)、图像处理器(Graphics Processing Unit,GPU)和调制解调器等中的一种或几种的组合。
存储器920可以包括随机存储器(Random Access Memory,RAM),也可以包括只读存储器(Read-Only Memory)。存储器920可用于存储指令、程序、代码、代码集或指令集。存储器920可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作系统的指令、用于实现至少一个功能的指令、用于实现上述各个方法实施例的指令等。存储数据区还可以服务器在使用中所创建的数据等。
请参考图16,其示出了本申请实施例提供的一种计算机可读存储介质的结构框图。该计算机可读存储介质940中存储有程序代码,所述程序代码可被处理器调用执行上述方法实施例中所描述的方法。
计算机可读存储介质940可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。可选地,计算机可读存储介质940包括非易失性计算机可读介质(non-transitory computer-readable storage medium)。计算机可读存储介质940具有执行上述方法中的任何方法步骤的程序代码941的存储空间。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。程序代码941可以例如以适当形式进行压缩。
最后应说明的是:以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不驱使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。

Claims (20)

  1. 一种离线支付方法,其特征在于,应用于移动终端,所述方法包括:
    在支付状态下,确定移动终端的网络是否可用;
    若网络不可用,基于短距离无线通信技术与收款设备建立直接连接;
    将付款账户信息加密后,通过所述直接连接发送给所述收款设备,以用于指示收款设备将所述付款账户信息以及收款信息发送到服务器进行扣款。
  2. 根据权利要求1所述的方法,其特征在于,
    所述将付款账户信息加密后,通过所述直接连接发送给所述收款设备,包括:
    将所述付款账户信息通过第一公钥加密后,通过所述直接连接发送给所述收款设备,以用于指示收款设备将所述付款账户信息以及收款信息发送到服务器进行扣款,并通过所述收款设备的转发指示所述服务器通过第一私钥解密所述付款账户信息,其中,所述移动终端存储有在网络可用时从服务器获取的第一公钥,所述第一公钥与第一私钥为一个密钥对。
  3. 根据权利要求2所述的方法,其特征在于,所述将所述付款账户信息通过所述第一公钥加密后,通过所述直接连接发送给所述收款设备,包括:
    将所述付款账户信息通过所述第一公钥加密后,封装成数据包,其中所述数据包中的头部目的地址封装为所述服务器的地址,源地址封装为空;
    将所述数据包通过所述直接连接发送给所述收款设备。
  4. 根据权利要求2或3所述的方法,其特征在于,所述将付款账户信息加密后,通过所述直接连接发送给所述收款设备之后,还包括:
    接收所述收款设备通过所述直接连接转发的由服务器发送到收款设备的收款信息,并显示;
    若接收到对所述收款信息的确认操作,通过所述直接连接向所述收款设备反馈确认信息,以用于指示所述收款设备将所述确认信息转发给所述服务器。
  5. 根据权利要求4所述的方法,其特征在于,
    所述接收所述收款设备通过所述直接连接转发的由服务器发送到收款设备的收款信息,并显示,包括:
    接收所述收款设备通过所述直接连接转发的由服务器发送到收款设备的收款信息,所述收款信息为通过第二公钥加密的数据,该第二公钥由移动终端在网络可用时发送到服务器;
    通过第二私钥对所述收款信息解密,其中,所述第二公钥与第二私钥为一个密钥对;
    根据解密后的收款信息显示,用于用户确认。
  6. 根据权利要求4或5所述的方法,其特征在于,所述若接收到对所述收款信息的确认操作,通过所述直接连接向所述收款设备反馈确认信息,包括:
    若接收到对所述收款信息的确认操作,记录所述确认操作的时间戳;
    将所述时间戳以及所述确认信息通过所述直接连接发送到所述收款设备,以用于通过收款设备的转发指示服务器根据所述时间戳判断所述确认信息是否有效。
  7. 根据权利要求4或5所述的方法,其特征在于,所述通过所述直接连接向所述收款设备反馈确认信息,包括:
    通过第一公钥对所述确认信息进行加密后,通过所述直接连接发送给所述收款设备,以用于通过所述收款设备对所述确认信息的转发,指示服务器通过第一私钥对所述确认信息进行解密。
  8. 根据权利要求1-7任一项所述的方法,其特征在于,所述基于短距离无线通信技术与收款设备建立直接连接,包括:
    提供用于基于短距离无线通信技术建立直接连接的识别信息,以用于所述收款设备根据所述识别信息与所述移动终端建立基于短距离无线通信技术的建立直接连接;
    与所述收款设备建立直接连接。
  9. 根据权利要求8任一项所述的方法,其特征在于,所述提供用于基于短距离无线通信技术直接连接的识别信息,包括:
    生成包括所述识别信息的编码信息的二维码。
  10. 根据权利要求1-8任一项所述的方法,其特征在于,基于短距离无线通信技术的直接连接为蓝牙连接。
  11. 一种离线支付方法,其特征在于,应用于收款设备,所述方法包括:
    基于预设触发方式,进入离线支付模式;
    基于短距离无线通信技术与移动终端建立直接连接;
    接收移动终端发送的付款账户信息;
    将所述付款账户信息以及收款信息发送到服务器。
  12. 根据权利要求11所述的方法,其特征在于,接收到的所述付款账户信息为加密后封装在数据包中,
    所述将所述付款账户信息以及收款信息发送到服务器,包括:
    对所述数据包解封装,获取其中服务器的地址以及加密的付款账户信息;
    将所述加密的付款账户信息与所述收款信息封装为数据包后发送到服务器,其中,该数据包中的目的地址封装为从解封装的数据包中获得的所述服务器的地址,源地址为所述收款设备的地址。
  13. 根据权利要求11所述的方法,其特征在于,所述方法还包括:
    接收服务器发送的收款信息;
    将所述收款信息通过所述直接连接发送到所述移动终端,用于指示所述移动终端进行确认。
  14. 一种离线支付方法,其特征在于,应用于服务器,所述方法包括:
    接收收款设备发送的付款账户信息以及收款信息,其中,所述付款账户信息为通过第 一公钥加密的数据;
    通过第一私钥对所述付款账户信息解密,其中,所述第一私钥与所述第一公钥为一个密钥对;
    根据收款信息以及解密后的所述付款账户信息进行扣款。
  15. 根据权利要求14所述的方法,其特征在于,所述服务器存储有移动终端在网络可用的状态下发送的第二公钥,所述根据收款信息以及解密后的所述付款账户信息进行扣款之前,还包括:
    将所述收款信息通过第二公钥进行加密,并发送给所述收款设备,以用于指示所述收款设备将加密后的收款信息转发给移动终端;
    接收收款设备发送的确认信息;
    若所述确认信息有效,执行所述根据收款信息以及解密后的所述付款账户信息进行扣款。
  16. 一种离线支付装置,其特征在于,应用于移动终端,所述装置包括:
    网络确认模块,用于在支付状态下,确定移动终端的网络是否可用;
    直连模块,用于若网络不可用,基于短距离无线通信技术与收款设备建立直接连接;
    信息发送模块,用于将付款账户信息加密后,通过所述直接连接发送给所述收款设备,以用于指示收款设备将所述付款账户信息以及收款信息发送到服务器进行扣款。
  17. 一种离线支付装置,其特征在于,应用于收款设备,所述装置包括:
    启动模块,用于基于预设触发方式,进入离线支付模式;
    直连模块,用于基于短距离无线通信技术与移动终端建立直接连接;
    信息接收模块,用于接收移动终端发送的付款账户信息;
    信息发送模块,用于将所述付款账户信息以及收款信息发送到服务器。
  18. 一种离线支付装置,其特征在于,应用于服务器,所述装置包括:
    信息接收模块,用于接收收款设备发送的付款账户信息以及收款信息,其中,所述付款账户信息为通过第一公钥加密的数据;
    解密模块,用于通过第一私钥对所述付款账户信息解密,其中,所述第一私钥与所述第一公钥为一个密钥对;
    扣款模块,用于根据收款信息以及解密后的所述付款账户信息进行扣款。
  19. 一种电子设备,其特征在于,包括:
    一个或多个处理器;
    存储器;
    一个或多个程序,其中所述一个或多个程序被存储在所述存储器中并被配置为由所述一个或多个处理器执行,所述一个或多个程序配置用于执行如权利要求1-10任一项所述的方法;或者
    所述一个或多个程序配置用于执行如权利要求11-13任一项所述的方法;或者
    所述一个或多个程序配置用于执行如权利要求14-15任一项所述的方法。
  20. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有程序代码,所述程序代码可被处理器调用执行如权利要求1-10任一项所述的方法;或者
    所述程序代码可被处理器调用执行如权利要求11-13任一项所述的方法;或者
    所述程序代码可被处理器调用执行如权利要求14或15所述的方法。
PCT/CN2019/086042 2019-05-08 2019-05-08 离线支付方法、装置、电子设备及存储介质 WO2020223932A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2019/086042 WO2020223932A1 (zh) 2019-05-08 2019-05-08 离线支付方法、装置、电子设备及存储介质
CN201980091192.2A CN113383356B (zh) 2019-05-08 2019-05-08 离线支付方法、装置、电子设备及存储介质

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/086042 WO2020223932A1 (zh) 2019-05-08 2019-05-08 离线支付方法、装置、电子设备及存储介质

Publications (1)

Publication Number Publication Date
WO2020223932A1 true WO2020223932A1 (zh) 2020-11-12

Family

ID=73050512

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/086042 WO2020223932A1 (zh) 2019-05-08 2019-05-08 离线支付方法、装置、电子设备及存储介质

Country Status (2)

Country Link
CN (1) CN113383356B (zh)
WO (1) WO2020223932A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023029701A1 (zh) * 2021-09-03 2023-03-09 浙江网商银行股份有限公司 任务处理系统、方法及装置

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117196613B (zh) * 2023-09-21 2024-03-15 北京小懂科技有限公司 一种离线收费方法、装置、计算机设备和存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104936128A (zh) * 2014-12-08 2015-09-23 深圳市腾讯计算机系统有限公司 一种离线数据转移方法、装置及系统
CN107665427A (zh) * 2017-08-22 2018-02-06 阿里巴巴集团控股有限公司 一种离线支付、业务处理、支付处理的方法及装置
CN109146470A (zh) * 2018-08-24 2019-01-04 北京小米移动软件有限公司 生成付款码的方法及装置

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106296197A (zh) * 2015-06-25 2017-01-04 深圳市中兴微电子技术有限公司 一种支付的方法、设备和系统
CN105550860A (zh) * 2015-12-11 2016-05-04 小米科技有限责任公司 支付方法及装置
CN206312224U (zh) * 2016-09-23 2017-07-07 深圳市微付充科技有限公司 支付系统
CN107944857A (zh) * 2017-10-31 2018-04-20 阿里巴巴集团控股有限公司 一种支付乘车费的方法及装置

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104936128A (zh) * 2014-12-08 2015-09-23 深圳市腾讯计算机系统有限公司 一种离线数据转移方法、装置及系统
CN107665427A (zh) * 2017-08-22 2018-02-06 阿里巴巴集团控股有限公司 一种离线支付、业务处理、支付处理的方法及装置
CN109146470A (zh) * 2018-08-24 2019-01-04 北京小米移动软件有限公司 生成付款码的方法及装置

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023029701A1 (zh) * 2021-09-03 2023-03-09 浙江网商银行股份有限公司 任务处理系统、方法及装置

Also Published As

Publication number Publication date
CN113383356A (zh) 2021-09-10
CN113383356B (zh) 2024-04-02

Similar Documents

Publication Publication Date Title
US10733603B2 (en) Method and apparatus for facilitating electronic payments using a wearable device
EP3358805B1 (en) Systems and methods for provisioning a camera with a dynamic qr code and a ble connection
US9473454B2 (en) Security gateway communication
EP2590356B1 (en) Method, device and system for authenticating gateway, node and server
WO2017041675A1 (zh) 一种发送和获取wifi联网信息的方法和对应装置
JP6228690B2 (ja) モバイルターミナルとposターミナルとの通信方法、通信システム及びposターミナル
KR100547855B1 (ko) 근거리 통신 장치를 구비한 복합 이동 통신 단말의 보안통신 시스템 및 방법
CN104137618A (zh) 经由对等链路的共享网络访问
WO2010057405A1 (zh) 利用短信息进行身份认证的方法
JP2013069277A (ja) Nfcリーダ装置、nfcタグ装置、nfcシステム及びnfc方法
WO2020223932A1 (zh) 离线支付方法、装置、电子设备及存储介质
WO2017044677A1 (en) Method and apparatus for facilitating electronic payments using a wearable device
CN113596827B (zh) 密钥生成方法、装置、电子设备及存储介质
US10542426B2 (en) System and method for transmitting a secure message over a signaling network
CN111147344B (zh) 一种虚拟专用网络实现方法、装置、设备及介质
CN112637839A (zh) 一种配网方法、装置、计算机设备和存储介质
CN104519019A (zh) 一种信息传输方法、装置及系统
CN116192403A (zh) 用于对摄像机供给动态qr码和ble连接的系统和方法
CN115801388A (zh) 报文传输方法、装置及存储介质
CN112039757A (zh) 一种蜂窝移动通信业务平台
CN116308688A (zh) 一种基于nfc自助服务终端的交易系统及方法
CN113193923A (zh) 一种远程测试方法,设备及系统
KR20120037262A (ko) 메시징 서비스 시스템 및 방법

Legal Events

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

Ref document number: 19927752

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19927752

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 11/05/2022)

122 Ep: pct application non-entry in european phase

Ref document number: 19927752

Country of ref document: EP

Kind code of ref document: A1