CN113383356B - Offline payment method and device, electronic equipment and storage medium - Google Patents

Offline payment method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113383356B
CN113383356B CN201980091192.2A CN201980091192A CN113383356B CN 113383356 B CN113383356 B CN 113383356B CN 201980091192 A CN201980091192 A CN 201980091192A CN 113383356 B CN113383356 B CN 113383356B
Authority
CN
China
Prior art keywords
information
mobile terminal
collection
server
network
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201980091192.2A
Other languages
Chinese (zh)
Other versions
CN113383356A (en
Inventor
方攀
陈岩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Shenzhen Huantai Technology Co Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Shenzhen Huantai Technology Co Ltd
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 Guangdong Oppo Mobile Telecommunications Corp Ltd, Shenzhen Huantai Technology Co Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Publication of CN113383356A publication Critical patent/CN113383356A/en
Application granted granted Critical
Publication of CN113383356B publication Critical patent/CN113383356B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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

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

The application discloses an offline payment method, an offline payment device, electronic equipment and a storage medium, and relates to the technical field of payment. The method applied to the mobile terminal comprises the following steps: in the payment state, determining whether a network of the mobile terminal is available; if the network is unavailable, establishing direct connection with the collection device based on a short-distance wireless communication technology; after the payment account information is encrypted, the payment account information is sent to the collection device through the direct connection, so that the collection device is instructed to send the payment account information and the collection information to a server for deduction, and electronic payment can be carried out when the mobile terminal is disconnected from the internet.

Description

Offline payment method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of payment technologies, and in particular, to an offline payment method, device, electronic apparatus, and storage medium.
Background
In the field of mobile payment, electronic payment by means of mobile terminals has become increasingly popular. However, electronic payment is performed through the mobile terminal, the dependence on the network is strong, and once the mobile terminal is disconnected, the payment cannot be performed.
Disclosure of Invention
In view of the above, the present application proposes an offline payment method, device, electronic device and storage medium, so as to improve the above problem.
In a first aspect, an embodiment of the present application provides an offline payment method, applied to a mobile terminal, where the method includes: in the payment state, determining whether a network of the mobile terminal is available; if the network is unavailable, establishing direct connection with the collection device based on a short-distance wireless communication technology; and after the payment account information is encrypted, the payment account information is sent to the collection equipment through the direct connection, so that the collection equipment is instructed to send the payment account information and the collection information to a server for deduction.
In a second aspect, an embodiment of the present application provides an offline payment method, applied to a collection device, where the method includes: entering an offline payment mode based on a preset triggering mode; establishing direct connection with the mobile terminal based on a short-range wireless communication technology; receiving payment account information sent by a mobile terminal; and sending the payment account information and the collection information to a server.
In a third aspect, an embodiment of the present application provides an offline payment method, applied to a server, where the method includes: receiving payment account information and collection information sent by collection equipment, wherein the payment account information is encrypted data through a first public key; decrypting the payment account information with a first private key, wherein the first private key and the first public key are a key pair; and deducting money according to the collection information and the decrypted payment account information.
In a fourth aspect, an embodiment of the present application provides an offline payment device, applied to a mobile terminal, where the device includes: the network confirming module is used for determining whether the network of the mobile terminal is available in a payment state; the direct connection module is used for establishing direct connection with the collection device based on a short-distance wireless communication technology if the network is unavailable; and the information sending module is used for sending the payment account information to the collection equipment through the direct connection after encrypting the payment account information so as to instruct the collection equipment to send the payment account information and the collection information to a server for deduction.
In a fifth aspect, an embodiment of the present application provides an offline payment device, applied to a collection device, where the device includes: the starting module is used for entering an offline payment mode based on a preset triggering mode; the direct connection module is used for establishing direct connection with the mobile terminal based on a short-distance wireless communication technology; the information receiving module is used for receiving payment account information sent by the mobile terminal; and the information sending module is used for sending the payment account information and the collection information to the server.
In a sixth aspect, an embodiment of the present application provides an offline payment device, applied to a server, where the device includes: the information receiving module is used for receiving payment account information and collection information sent by the collection equipment, wherein the payment account information is encrypted data through a first public key; the decryption module is used for decrypting the payment account information through a first private key, wherein the first private key and the first public key are a key pair; and the deduction module is used for deducting money according to the collection information and the decrypted payment account information.
In a seventh aspect, embodiments of the present application provide 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 configured to perform the methods described above.
In an eighth aspect, embodiments of the present application provide a computer readable storage medium having program code stored therein, the program code being callable by a processor to perform the method described above.
According to the offline payment method, the offline payment device, the electronic equipment and the storage medium, when the mobile terminal network is unavailable, the account information is sent to the collection equipment by establishing direct connection with the collection equipment, and payment is deducted through connection between the collection equipment and the server, so that the electronic payment can be performed when the mobile terminal is disconnected.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 shows an interaction diagram of an offline payment system provided in an embodiment of the present application.
Fig. 2 shows a timing diagram of an offline payment method according to an embodiment of the present application.
Fig. 3 shows a bluetooth data encapsulation structure provided in an embodiment of the present application.
Fig. 4 shows a schematic diagram of a packet format according to an embodiment of the present application.
Fig. 5 shows a timing state diagram of an offline payment method according to another embodiment of the present application.
Fig. 6 shows another schematic diagram of a packet format according to an embodiment of the present application.
Fig. 7 shows still another schematic diagram of a packet format according to an embodiment of the present application.
Fig. 8 shows a timing state diagram of an offline payment method according to 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 collection device according to an embodiment of the present 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 block diagram of an offline payment device applied to a mobile terminal according to an embodiment of the present application.
Fig. 13 is a functional block diagram of an offline payment device applied to a collection device according to an embodiment of the present application.
Fig. 14 shows a functional block diagram of an offline payment device applied to a server according to an embodiment of the present application.
Fig. 15 shows a block diagram of an electronic device according to an embodiment of the present application.
Fig. 16 is a storage unit for storing or carrying program code for implementing an offline payment method according to an embodiment of the present application.
Detailed Description
In order to enable those skilled in the art to better understand the present application, the following description will make clear and complete descriptions of the technical solutions in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application.
With the development of mobile payment technology, electronic payment through mobile terminals has become more and more common. When electronic payment is carried out through the mobile terminal, the mobile terminal network must be ensured to be normal, and the payment can be completed. However, in a practical scenario, the network state of the mobile terminal cannot be guaranteed to be normal, and usually the network connection is unstable or fails, so that the network connection is not available and cannot interact with the server. For example, in a mall where the traffic is relatively large, the cellular network or the wireless lan is often heavily loaded, the mobile data network of the mobile phone may not be available, and the code scanning payment cannot be performed.
The inventor finds through research that in the electronic payment scene, the collection device of the collection party is usually a fixed device, and can ensure a more stable wireless network connection or a wired network connection. Therefore, the inventor proposes a solution for forwarding a network data packet of a mobile phone by using a collection device, so that the mobile phone can complete passive code scanning payment under a network-free condition.
Specifically, in order to overcome the above-mentioned various drawbacks, the inventor proposes an offline payment method, an apparatus, an electronic device, and a storage medium according to embodiments of the present application, and in a payment state, if it is determined that a network of a mobile terminal is unavailable, the mobile terminal establishes a direct connection with a collection device, encrypts account information and sends the encrypted account information to the collection device.
The offline payment method, the device, the electronic equipment and the storage medium provided by the embodiment of the application can be applied to an offline payment system as shown in fig. 1. As shown in fig. 1, the offline payment system includes a mobile terminal 101, a collection device 102, and a server 103. The mobile terminal can be an intelligent device capable of performing electronic payment, such as a mobile phone, a tablet computer and an intelligent watch. The collection device is an intelligent device capable of collecting money, such as a cash register, a computer, etc., and the server may be a server or a server cluster formed by a plurality of servers.
Referring to fig. 1, a mobile terminal may connect to a server through a base station 104 or connect to the server through a hotspot 105 in a network-available state, and perform data interaction with the server. I.e. the mobile terminal may establish a connection with the server via a mobile data network or a wireless local area network. The checkout device 102 may also establish a network connection with a server through a mobile data network or a wireless local area network. In addition, when the mobile terminal is within a certain distance range of the collection device, the mobile terminal and the collection device may establish a direct connection based on a short-range wireless communication technology, as shown in fig. 1. Referring to fig. 2, the method applied to the offline payment system may include:
step S110: the mobile terminal determines whether a network is available in a payment state.
When electronic payment is required to be carried out through the mobile terminal, the user can operate and control the mobile terminal to enter a payment state. The payment state may be a state in which a payment application is opened, a state in which a payment interface is opened under the payment application (such as a payment two-dimensional code display page and a payment scan page), and the like, and may be considered as a payment state of the mobile terminal as long as the mobile terminal prepares for electronic payment.
When the mobile terminal is in a payment state, it is determined whether a network is available. The network may include a cellular network, i.e., a mobile data network, a wireless local area network, etc., and the mobile terminal may perform data interaction with the server through the network in a state where the network is available.
If the network is unavailable in the payment state of the mobile terminal, the payment can be completed by forwarding the data through the collection device.
Alternatively, the network may not be available, i.e. the mobile terminal fails to connect to the WiFi and the mobile data network, etc.; the mobile terminal is connected with the network, but the connected network cannot transmit and receive data; the network connection may be unavailable, where the mobile terminal is connected to a mobile data network, but the current traffic usage of the mobile data network account corresponding to the mobile terminal has exceeded a usable highest threshold, where the highest threshold indicates that the mobile terminal cannot use the mobile data network any more after the traffic exceeds the threshold.
In the embodiment of the present application, the method for determining the network state of the mobile terminal is not limited, and for example, the network connection state and the network connection type of the device can be monitored through a ConnectivityManager; the change of network connection can be detected by registering broadcast BreadcastReceiver; the connection status and the network connection type of the network of the device may be monitored by phonestatelist, etc.
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 not available, the collection device enters an offline payment mode.
If the network of the mobile terminal is not available, the mobile terminal needs to send payment account information to the server through the collection device for deduction, so that the mobile terminal can start an offline payment mode. Correspondingly, since the collection device needs to receive the account information of the mobile terminal and forward the account information to the server, the collection device also needs to correspondingly enter the offline payment mode.
The mobile terminal can enter an offline payment mode when detecting that the network is not available.
The manner in which the checkout device enters the offline payment mode may be based on a preset trigger manner. The preset triggering mode may be an operation of the cashier corresponding to the cashing device to enable the cashing device to enter an offline payment mode; or the collection equipment scans the payment two-dimensional code of the mobile terminal to fail collection; or the collection equipment scans a two-dimensional code which is provided by the mobile terminal and used for representing the disconnection of the network connection; or the collection device scans a two-dimensional code or the like provided by the mobile terminal for representing the direct connection request. The two-dimensional code representing the disconnection of the network connection and the two-dimensional code representing the direct connection request may be the same two-dimensional code or different two-dimensional codes. In the embodiment of the present application, in order to cooperate with a mobile terminal for which network connection is unavailable, the collection device may enter the offline payment mode, and the manner of entering 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 collection device.
In the offline payment mode, the mobile terminal and the checkout device may establish a direct connection based on a short-range wireless communication technology. The direct connection means that the mobile terminal and the checkout device are point-to-point connections without an intermediate access point therebetween. In this embodiment of the present application, the direct connection may be a bluetooth connection, a WiFi direct connection, an NFC connection, or other, which may be implemented without relying on a data network and transmitting data between the mobile terminal and the collection device. In the embodiments of the present application, bluetooth connection is mainly used as a direct connection example for illustration.
In the embodiment of the present application, the manner of establishing the direct connection between the mobile terminal and the collection device may be that, in an offline payment mode, the mobile terminal provides identification information for establishing the direct connection based on a short-range wireless communication technology, so that the collection device establishes the direct connection with the mobile terminal based on the short-range wireless communication technology according to the identification information; correspondingly, the mobile terminal establishes direct connection with the collection device.
Specifically, the mobile terminal may generate a two-dimensional code including encoded information of the identification information, the two-dimensional code indicating that the mobile terminal initiates a direct connection request to the reception apparatus. Included in the identification information is information that can be used to identify the mobile terminal directly connected to the mobile terminal. For example, if the identification information may include a mac address and a password for the mobile terminal to directly connect, the collecting device may obtain the mac address of the mobile terminal by scanning the two-dimensional code, and establish a direct connection with the mobile terminal according to the mac address and the password.
For example, the mobile terminal generates and displays a two-dimensional code including 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 collection device. After the two-dimension code is scanned by the collection equipment, a Bluetooth mac address and a password value of the mobile terminal are obtained, a Bluetooth connection request is initiated to the mobile terminal based on the mac address and the password value, and Bluetooth connection is established with the mobile terminal.
Step S150: and the mobile terminal encrypts the payment account information and then sends the payment account information to the collection equipment through the direct connection.
After the mobile terminal establishes direct connection with the collection device, the payment account information for payment is encrypted and then sent to the collection device through the direct connection with the collection device. The payment account information can be information of an account logged in by a payment application program in the mobile terminal, and can be specifically provided by the payment application program; the payment account information may also be other account information stored in the mobile terminal that may be used for electronic payment.
The payment account information sent to the payment device by the mobile terminal needs to be forwarded to the server by the payment device, so that the payment account information is encrypted in a manner that the payment device cannot decrypt and the server can decrypt.
In the embodiment of the application, encryption and decryption can be performed through a key pair. Specifically, the server may have a key pair, after the public key in the key pair encrypts the data, the public key in the key pair may be used to decrypt the data, define the public key in the key pair as the first public key, define the private key in the key pair as the first private key, and the server holds the first private key and sends the first public key to the mobile terminal for encrypting the data. The mobile terminal may acquire a first public key provided by the server from the server and store the first public key when the network is available.
When the payment account information needs to be forwarded to the server through the collection device in the offline payment mode, the mobile terminal can encrypt the payment account information through the first public key and then send the payment account information to the collection device through the direct connection.
In the embodiment of the application, the mobile terminal can package payment account information into a data packet and send the data packet to the collection device. Specifically, the destination address of the header in the data packet is encapsulated as the address of the server, and since the mobile terminal has no network connection, the source address of the header in the data packet is encapsulated as null, so that when the data packet is received by the collection device, the source address is filled as the address of the collection device. The address of the server is the address of the server for deducting money, and indicates the server to which the payment account information needs to arrive.
For example, the mobile terminal is connected with the payment device bluetooth in the offline payment mode, encrypts the payment account information through the first public key, encapsulates the payment account information into an IP data packet through the payment application program, sends the IP data packet to the bluetooth module, encapsulates the IP data packet by the bluetooth module using the bluetooth network encapsulation protocol (BNEP, bluetooth Network Encapsulation Protocol), as shown in fig. 3, and sends the IP data packet to the payment device through the bluetooth connection. In fig. 3, IP denotes an IP packet, IP header denotes a header of the IP packet, L2CAP and SDP are bluetooth basic protocols, and are not described here.
Step S160: the collection device receives payment account information sent by the mobile terminal.
The checkout device receives payment account information sent by a mobile terminal directly connected thereto over the direct connection.
And when the mobile terminal encapsulates the payment account information into a data packet and then sends the data packet to the collection equipment, the collection equipment unpacks the data packet to acquire the encrypted payment account information. In addition, the checkout device may also obtain the server address in the data packet.
In addition, if the mobile terminal is connected with the Bluetooth of the collection device, the Bluetooth module of the collection device receives the IP data packet encapsulated by the BNEP protocol, the IP data packet is decapsulated, the IP data packet is sent to the corresponding collection processing unit, and the collection processing unit extracts the payment account information encrypted in the IP data packet.
Step S170: the collection device sends the payment account information and collection information to a server.
The collecting device transmits the encrypted payment account information and its collecting information to the server, wherein the collecting information may include an amount to be paid, account information of a collecting party, and the like.
Specifically, the collection device may package the payment account information and the collection information into a new data packet through the collection processing unit and then send the new data packet to the server. When the data packet is encapsulated, the address of the collecting device is taken as the source address of the header of the data packet, the address of the server is taken as the destination address of the header, the encapsulated data packet can be an IP data packet, the format is shown in fig. 4, and in fig. 4, the IP header represents the header of the encapsulated IP data packet. Optionally, the address of the server may be a destination address encapsulated in a data packet sent by the mobile terminal; alternatively, the address of the server may be determined by the collecting device according to the corresponding connected server for collecting money.
That is, the source address is the address of the collection device, and the destination address encapsulation may be the address of the server obtained from the decapsulated data packet, in the data packet in which the collection device encapsulates the payment account information and the collection information.
Step S180: and the server deducts money according to the payment account information and the collection information sent by the collection equipment.
The server can determine an account to be deducted according to the payment account information sent by the collection device; and determining the deduction amount and the collected account according to the collection information, so that the deduction operation can be completed.
In particular, the server may decapsulate the data packet sent from 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 via the first private key, and may obtain the decrypted payment account information.
Further, in order to ensure the payment security, the server may make a deduction when the user confirms the payment, by preventing the payment account information sent by the payment terminal from not obtaining the payment permission of the user.
Specifically, as shown in fig. 5, in the embodiment of the present application, before deducting money according to the payment account information and the payment information sent by the payment device, the server may further include:
step S171: the server encrypts the collection information through the second public key and sends the collection information to the collection device.
The mobile terminal may hold a key pair, define a public key of the key pair as the second public key, and define a private key of 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, the server storing the second public key.
The server encrypts the collection information through the second public key and sends the encrypted collection information to the collection device. The collection information may include collection account information, collection amount, and the like.
Specifically, the server may encapsulate the data sent to the collection device into a data packet, where the destination address of the header of the data packet is the address of the collection device, and the address may be obtained from the collection device that completely sends the data, or may be obtained from the source address in the data packet sent to the server by the collection device. The header source address of the packet is the address of the server itself. A schematic diagram of the format of a server encapsulated IP packet is shown in fig. 6.
Optionally, in the data sent to the collection device, as shown in fig. 6, a timeout may be further included for informing the mobile terminal that the time of confirmation cannot exceed the timeout.
Step S172: the collection device receives collection information sent by the server.
Step S173: the collection device transmits the collection information to the mobile terminal through the direct connection.
After receiving the data sent by the server, the collection device forwards the data to the mobile terminal.
The packaging form of the data forwarded to the mobile terminal by the collection device is matched with the connection mode between the collection device and the mobile terminal. For example, after receiving a data packet sent by the server, the collection device sends the data packet to a bluetooth module of the host, and the bluetooth module encapsulates the data packet by using a BNEP protocol and forwards the data packet to the mobile terminal through bluetooth.
Step S174: and the mobile terminal receives and displays the collection information which is forwarded by the direct connection and sent to the collection equipment by the server.
The mobile terminal receives the data forwarded by the collection device, obtains collection information, and displays the collection information for user confirmation.
Specifically, the mobile terminal receives the collection information which is transmitted to the collection equipment by the server and forwarded by the collection equipment through direct connection, wherein the collection information is data encrypted through a second public key; decrypting the receipt information through the second private key, and displaying according to the decrypted receipt information for user confirmation. Of course, it can be understood that if the data included in the data sent by the server includes more than the collection information, and if the data further includes the timeout time, the mobile terminal may further obtain the timeout time after decrypting the data.
For example, the bluetooth module of the mobile terminal receives the data packet encapsulated by the BNEP protocol, sends the data packet to the payment application program of the mobile terminal, decrypts the data packet through the second private key by the payment application program, obtains the data encapsulated and sent by the server such as the collection information and the overtime time, and displays the data.
Specifically, when the mobile terminal displays, the information of the collection account can be displayed so that the user confirms the collection party; the amount of money collected may be displayed to allow the user to confirm whether the amount to be deducted is correct. In addition, optionally, the data sent by the server further comprises an overtime, and the overtime can be displayed to remind the user to confirm the displayed collection information before the overtime.
Step S175: and if the mobile terminal receives the confirmation operation of the collection information, the mobile terminal feeds back the confirmation information to the collection equipment through the direct connection.
The mobile terminal displays the receipt information for user confirmation. If the user confirms that the collection information is correct, a confirmation operation can be performed.
If the mobile terminal receives the confirmation operation of the collection information, the confirmation information can be fed back to the collection equipment through the direct connection, the confirmation information indicates that the user triggers the operation of confirming the collection information correctly at the mobile terminal, and the confirmation information is used for deducting money according to the confirmation information through a forwarding indication server of the collection equipment.
Optionally, in order to prevent Man-in-the-MiddleAttack, MITM attack, if the mobile terminal receives a confirmation operation of the receipt information, the mobile terminal records a 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 collection device through the direct connection, so as to determine whether the confirmation information is valid according to the time stamp through a forwarding indication server of the collection device.
If the time stamp exceeds the timeout, as an implementation manner, the mobile terminal may send the time stamp and the confirmation information to the collection device through the direct connection, so as to determine whether the confirmation information is valid according to the time stamp through a forwarding indication server of the collection device. Wherein the time stamp exceeds the timeout, which indicates that the trigger time of the user confirmation operation exceeds the timeout, and the confirmation information is invalid.
If the timestamp exceeds the timeout period, as another implementation manner, the mobile terminal may feed back identification information that the confirmation information is invalid to the server, so that when the server receives the confirmation information fed back by the collecting device, the confirmation information is determined to be invalid due to timeout through the identification information that the confirmation information is invalid.
Specifically, the mobile terminal may encrypt the confirmation information and/or the timestamp with the first public key, and then send the encrypted confirmation information and/or the timestamp to the collection device through the direct connection, so as to be used for forwarding the confirmation information through the collection device, and instruct the server to decrypt the confirmation information with the first private key. The mobile terminal can package the encrypted information into a data packet and send the data packet to a local Bluetooth module, and the data packet is packaged by the Bluetooth module through BNEP protocol and then sent to the money receiving equipment through Bluetooth connection. As shown in fig. 7, the data packet may be an IP data packet, and the format thereof may be the data format shown in fig. 7.
Step S176: the checkout device forwards the confirmation information to the server.
The receiving device receives the confirmation information sent by the mobile terminal and sends the confirmation information to the server. Of course, if the mobile terminal transmits a time stamp, the collection device also receives the time stamp and transmits it to the server.
Specifically, after receiving the data packet encapsulated by the BNEP protocol, the bluetooth module of the collecting device decapsulates the data packet therein and sends the data packet to the collecting processing unit. The collection processing unit forwards the data packet to the server via a network connection with the server.
Step S177: the server receives the confirmation information sent by the collection device. If the confirmation information is valid, the step S180 is executed.
The server receives the data sent by the collection device and obtains the confirmation information. If the confirmation information is valid, the user corresponding to the payment account is indicated to determine payment, and the amount corresponding to the collection amount in the collection information is deducted from the payment account corresponding to the payment account information.
Wherein the payment account information may be data encrypted by a first public key, and the server decrypts the payment account information by a first private key. Of course, if the data forwarded by the collection device further includes a timestamp, the server may also obtain the timestamp after decrypting.
Specifically, the server receives a data packet sent by the collection device, decrypts the data packet through the first private key, and obtains confirmation information in the data packet. If the data packet sent by the collection device includes a time stamp, the server obtains the time stamp at the same time. And the server judges whether the time stamp exceeds the timeout time, if not, the server indicates that the time for the user to carry out the confirmation operation does not exceed the timeout time, the confirmation information is effective, and the server deducts money from the payment account corresponding to the payment account information.
If the time stamp exceeds the timeout time, the confirmation information in the data packet is invalid, and the server does not deduct money from the payment account corresponding to the payment account information. Correspondingly, the failure of deduction can be fed back to the collection equipment and the mobile terminal.
Optionally, if the data packet forwarded by the collecting device does not include a time stamp, but includes identification information indicating that the confirmation information is invalid, it is determined that the confirmation information in the data packet is invalid, and the server does not deduct the payment account corresponding to the payment account information.
Further, in the embodiment of the present application, after the server deducts money successfully, the deduction result may also be fed back to the collection device and the mobile terminal.
As one embodiment, the data for notifying the payment information of the payment device, which is transmitted to the payment device, may include the payment amount, the name of the payer, and the like. And the cash collecting equipment receives the deduction result and displays the deduction result. And (3) encrypting the deduction result sent to the mobile terminal through the second public key, packaging the encrypted deduction result into a data packet, sending the data packet to the collection equipment, and forwarding the data packet to the mobile terminal through direct connection by the collection equipment. And the mobile terminal decrypts the data packet through the second private key, obtains the deduction result and displays the deduction result. The deduction result sent to the mobile terminal may include data such as a deduction amount, a payee account name, and the like. The display of the mobile terminal may be implemented by a payment application.
As another implementation, the server may feed back to the payee device a payment result, which may include the payment amount and payee information, and not encrypted by the second public key. The payment receiving device receives the payment result, displays the payment amount and other information in the payment result, and sends the payment result to the mobile terminal through direct connection. And the mobile terminal displays the deduction result after receiving the deduction result.
In the embodiment of the application, in a payment state, if the mobile terminal is not available on the network, the payment account information is forwarded to the server through the payment collecting device, the payment collecting device simultaneously sends the payment collecting information to the server, and the server deducts money according to the payment collecting information sent by the payment collecting device and the forwarded payment account information.
FIG. 8 illustrates the interaction of a mobile terminal, a checkout device, and a server in a particular embodiment. Referring to fig. 8, the offline payment method provided in this embodiment is described with bluetooth connection as a direct connection between a mobile terminal and a collection device, and includes:
step S201: when the network of the mobile terminal is available, the server sends a first public key to the mobile terminal and holds a 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, it is determined whether a network of the mobile terminal is available.
Step S203: and 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 including a bluetooth mac address and a password value required when establishing a bluetooth connection.
Step S205: the collection device scans the two-dimensional code.
Step S206: and the collection equipment establishes Bluetooth connection with the mobile terminal according to the identification information obtained by scanning the two-dimensional code.
Step S207: the mobile terminal encrypts the payment account information using the first public key and encapsulates the payment account information into an IP data packet.
Step S208: the mobile terminal encapsulates the IP packet using the BNEP protocol and transmits to the payment device via bluetooth.
Step S209: the collection device unpacks the IP data packet, extracts the encrypted payment account information, and encapsulates the collection information and the encrypted payment account information together into a new IP data packet.
Step S210: the collection device sends the IP data packet to the server through the network connection.
Step S211: the server acquires the collection information and the payment account information from the IP data packet sent by the collection device, and decrypts the payment account information through the first private key.
Step S212: the server encrypts the collection information and the overtime time through the second public key and encapsulates the collection information and the overtime time into an IP data packet.
Step S213: the server sends the IP data packet to the checkout device.
Step S214: the collection device packages the IP data packet through BNEP protocol and forwards the IP data packet to the mobile terminal through Bluetooth connection.
Step S215: the mobile terminal unpacks the IP data packet, decrypts the collection information and the overtime time by using the second private key, and displays the collection information and the overtime time.
Step S216: the mobile terminal receives the confirmation operation of the user and records the time stamp information of the confirmation operation.
Step S217: and the mobile terminal encrypts the confirmation information corresponding to the confirmation operation and the timestamp information by using the first public key, and encapsulates the encrypted confirmation information and the timestamp information into an IP data packet.
Step S218: and the mobile terminal encapsulates the IP data packet by using BNEP protocol and sends the IP data packet to the money receiving equipment through Bluetooth connection.
Step S219: the collection device decapsulates to obtain the IP data packet.
Step S220: the checkout device forwards the IP data packet to the server.
Step S221: the server decrypts the acknowledgement information and the timestamp information in the data packet by the first private key. And if the confirmation information is determined to be valid according to the timestamp information, deducting money according to the payment account information and the collection information.
Step S222: and packaging the deduction result into an IP data packet and then sending the IP data packet to the collection device.
Step S223: and the collection equipment displays according to the deduction result.
Step S224: the collection device sends the IP data packet to the mobile terminal through Bluetooth connection.
Step S225: and the mobile terminal acquires and displays the deduction result from the IP data packet.
The specific execution of each step in the embodiments of the present application may refer to the foregoing embodiments, and the embodiments of the present application are not repeated.
The embodiment of the application also provides an offline payment method, which is applied to the mobile terminal. Referring to fig. 9, the method includes:
step S310: in the payment state, it is determined whether a network of the mobile terminal is available.
Step S320: if the network is not available, a direct connection is established with the checkout device based on a short-range wireless communication technology.
Step S330: and after the payment account information is encrypted, the payment account information is sent to the collection equipment through the direct connection, so that the collection equipment is instructed to send the payment account information and the collection information to a server for deduction.
The mobile terminal determines whether a network is available in a payment state to select different payment policies according to whether the network is available or unavailable.
If the network is available, the mobile terminal communicates with the server normally through the available mobile data network or the wireless local area network to pay.
If the network of the mobile terminal is not available, a direct connection is established with the collection device based on the short-distance wireless communication technology so as to send payment account information to the server for payment through forwarding of the collection device. Specifically, after the mobile terminal encrypts the payment account information, the payment account information is sent to the collection equipment through direct connection, so that the collection equipment is instructed to forward the payment account information to the server for payment, and electronic payment of the mobile terminal in a network-free available state is realized.
The steps executed by the mobile terminal in the embodiments of the present application may refer to the foregoing embodiments specifically, and are not described herein in detail.
The embodiment of the application also provides an offline payment method which is applied to the collection equipment. As shown in fig. 10, the method includes:
step S410: and entering an offline payment mode based on a preset triggering mode.
Step S420: a direct connection is established with the mobile terminal based on a short-range wireless communication technology.
Step S430: and receiving payment account information sent by the mobile terminal.
Step S440: and sending the payment account information and the collection information to a server.
When the mobile terminal is not available in the network in the payment state, the payment receiving equipment is required to cooperate, and the offline payment mode is started to finish the payment. The collection device enters the offline payment mode and can have a preset trigger mode, when the collection device receives the preset trigger mode, the collection device indicates that the mobile terminal needs to pay under the condition that no network is available, and the collection device establishes direct connection with the mobile terminal.
The payment receiving device receives payment account information sent by the mobile terminal through the direct connection, sends the payment account information and the payment receiving information to the server, and the server deducts money to realize electronic payment of the mobile terminal in a network-free available state.
The steps executed by the cash register in the embodiment of the present application may refer to the foregoing embodiments specifically, and will not be described herein again.
The embodiment of the application also provides an offline payment method which is applied to the server. As shown in fig. 11, the method includes:
step S510: and receiving payment account information and collection information sent by the collection equipment, wherein the payment account information is data encrypted through a first public key.
Step S520: decrypting the payment account information with a first private key, wherein the first private key and the first public key are a key pair.
Step S530: and deducting money according to the collection information and the decrypted payment account information.
In the offline payment mode, the payment account information and the payment information received by the server are transmitted by the payment receiving device. In order to ensure the security of the data, the payment account information transmitted by the mobile terminal to the collection device for forwarding may be encrypted by the first public key. The server decrypts the payment account information with the first private key so that the payment account information is made known only to the server.
And the server deducts money according to the collection information and the decrypted payment account information, so that the electronic payment of the mobile terminal in a network-free available state is realized.
The embodiment of the application also provides an offline payment device 600, which is applied to a mobile terminal. Referring to fig. 12, the apparatus 600 includes: a network confirmation module 610, configured to determine whether a network of the mobile terminal is available in a payment state; a direct connection module 620, configured to establish a direct connection with the collection device based on the short-range wireless communication technology if the network is unavailable; the information sending module 630 is configured to send the encrypted payment account information to the payment collecting device through the direct connection, so as to instruct the payment collecting device to send the payment account information and the payment collecting information to the server for payment deduction.
Optionally, the information sending module 630 may be configured to send the payment account information to the collection device through the direct connection after the payment account information is encrypted by the first public key, so as to instruct the collection device to send the payment account information and the collection information to the server for deduction, and instruct the server to decrypt the payment account information through a first private key through forwarding of the collection device, where the mobile terminal stores a first public key acquired from the server when the network is available, and the first public key and the first private key are a key pair.
Optionally, the information sending module 630 is configured to send the payment account information to the collection device through the direct connection after encrypting the payment account information with the first public key, and may include: the payment account information is encrypted through the first public key and then packaged into a data packet, wherein a head destination address in the data packet is packaged into an address of the server, and a source address is packaged into an empty address; and sending the data packet to the collection device through the direct connection.
Optionally, the apparatus 600 may further include an information receiving module 640, configured to receive and display the receipt information forwarded by the receipt device through the direct connection and sent to the receipt device by the server. The information sending module 630 may be further configured to, if a confirmation operation for the receipt information is received, feed back confirmation information to the receipt device through the direct connection, so as to instruct the receipt device to forward the confirmation information to the server.
Optionally, the information receiving module 640 may be configured to receive the payment information forwarded by the payment device through the direct connection and sent to the payment device by the server, where the payment information is data encrypted by a second public key, and the second public key is sent to the server by the mobile terminal when the network is available; decrypting the collection information through a second private key, wherein the second public key and the second private key are a key pair; display according to decrypted receipt information for user confirmation
Optionally, the information sending module 630 is configured to feed back confirmation information to the collecting device, and may include recording a timestamp of a confirmation operation of the collecting device if the confirmation operation is received; and sending the timestamp and the confirmation information to the collection device through the direct connection, so as to judge whether the confirmation information is valid or not according to the timestamp through a forwarding indication server of the collection device.
Optionally, the information sending module 630 may be configured to encrypt the confirmation information with a first public key, send the encrypted confirmation information to the collection device through the direct connection, and forward the confirmation information through the collection device, so as to instruct the server to decrypt the confirmation information through a first private key.
Optionally, the direct connection module 620 may be configured to provide identification information for establishing a direct connection based on a short-range wireless communication technology, so that the collection device establishes a direct connection based on a short-range wireless communication technology with the mobile terminal according to the identification information; a direct connection is established with the checkout device.
Optionally, 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: and generating a two-dimensional code of the coded information comprising the identification information.
The embodiment of the application also provides an offline payment device 700 which is applied to a collection device. Referring to fig. 13, the apparatus 700 includes: a starting module 710, configured to enter an offline payment mode based on a preset trigger mode; a direct connection module 720, configured to establish a direct connection with the mobile terminal based on a short-range wireless communication technology; an information receiving module 730, configured to receive payment account information sent by the mobile terminal; and an information transmitting module 740 for transmitting the payment account information and the receipt information to the server.
Optionally, the information sending module 740 may be configured to decapsulate the data packet, and obtain the address of the server and encrypted payment account information therein; and packaging the encrypted payment account information and the collection information into a data packet and then sending the data packet to a server, wherein a destination address in the data packet is packaged into an address of the server obtained from the unpacked data packet, and a source address is an address of the collection device.
Optionally, the apparatus may further include another information receiving module, configured to receive the payment information sent by the server; and the other information sending module is used for sending the collection information to the mobile terminal through the direct connection and indicating the mobile terminal to confirm.
The embodiment of the application also provides an offline payment device 800, which is applied to a server. Referring to fig. 14, the apparatus 800 includes: the information receiving module 810 is configured to receive payment account information and collection information sent by a collection device, where the payment account information is data encrypted by a first public key; a decryption module 820, configured to decrypt the payment account information by using a first private key, where the first private key and the first public key are a key pair; and the deduction module 830 is configured to deduct money according to the collection information and the decrypted payment account information.
Optionally, the apparatus 800 may further include a confirmation module configured to encrypt the collection information with a second public key, and send the encrypted collection information to the collection device, so as to instruct the collection device to forward the encrypted collection information to the mobile terminal; and receiving confirmation information sent by the collection equipment. If the confirmation information is valid, the deduction module 830 is configured to deduct money according to the collection information and the decrypted payment account information.
In the embodiment of the application, if the mobile terminal has no network connection in the payment state, the collection device can be used as a relay, and the payment account information is forwarded to the server through the collection device. And the server deducts money according to the collection information sent by the collection equipment and the payment account information forwarded by the collection equipment, so that the electronic payment of the mobile terminal without network connection is realized.
It will be apparent to those skilled in the art that, for convenience and brevity of description, reference may be made to the above-described embodiments of the method; the method embodiments may also be referred to each other. The specific working process of the above-described device and module may refer to the corresponding process in the foregoing method embodiment, which is not described herein again.
In several embodiments provided herein, the coupling of the modules to each other may be electrical, mechanical, or other.
In addition, 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 integrated modules may be implemented in hardware or in software functional modules.
Referring to fig. 15, a block diagram of an electronic device 900 according to an embodiment of the present application is shown. The electronic device 900 may be a mobile terminal, a checkout device, or a server. The electronic device includes one or more processors 910 (only one shown), memory 920, and one or more programs. Wherein 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 perform the methods described in the previous embodiments.
Processor 910 may include one or more processing cores. The processor 910 utilizes various interfaces and lines to connect various portions of the overall electronic device 900, perform various functions of the electronic device 900, and process data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 920, and invoking data stored in the memory 920. Alternatively, the processor 910 may be implemented in hardware in at least one of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), programmable logic array (Programmable Logic Array, PLA). The processor 910 may integrate one or a combination of several of a central processing unit (Central Processing Unit, CPU), an image processor (Graphics Processing Unit, GPU), and a modem, etc.
The Memory 920 may include a random access Memory (Random Access Memory, RAM) or a Read-Only Memory (Read-Only Memory). Memory 920 may be used to store instructions, programs, code, sets of codes, or instruction sets. The memory 920 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for implementing at least one function, instructions for implementing the various method embodiments described above, and the like. The storage data area may also be data created by the server in use, etc.
Referring to fig. 16, a block diagram of a computer readable storage medium according to an embodiment of the present application is shown. The computer readable storage medium 940 has stored therein program code that can be invoked by a processor to perform the methods described in the method embodiments described above.
The computer readable storage medium 940 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read only memory), an EPROM, a hard disk, or a ROM. Optionally, computer readable storage medium 940 includes non-volatile computer readable medium (non-transitory computer-readable storage medium). The computer readable storage medium 940 has storage space for program code 941 that performs any of the method steps described above. The program code can be read from or written to one or more computer program products. Program code 941 may be compressed, for example, in a suitable form.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and are not limiting thereof; although the present application has been described in detail with reference to the foregoing embodiments, one of ordinary skill in the art will appreciate that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not drive the essence of the corresponding technical solutions to depart from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims (14)

1. An offline payment method, characterized in that it is applied to a mobile terminal, said method comprising:
in the payment state, determining whether a network of the mobile terminal is available;
if the mobile terminal network connection fails, the network connected with the mobile terminal cannot transmit and receive data, or the current used flow of the mobile data network account corresponding to the mobile terminal exceeds the highest flow threshold value under the condition that the mobile terminal is connected with the mobile data network, determining that the network is unavailable, and establishing direct connection with the collection device based on a short-distance wireless communication technology;
encrypting payment account information through a first public key, and packaging the payment account information into a data packet, wherein a head destination address in the data packet is packaged into an address of a server, a source address is packaged into a null address, the mobile terminal stores the first public key acquired from the server when a network is available, the first public key and a first private key are a key pair, and the encryption mode of the payment account information is a mode that the collection equipment cannot decrypt and the server can decrypt;
the data packet is sent to the collection device through the direct connection, so that the collection device is instructed to send the payment account information and the collection information to a server for deduction, and the server is instructed to decrypt the payment account information through the first private key through forwarding of the collection device;
Receiving the collection information transmitted to the collection device by the server and forwarded by the collection device through the direct connection, wherein the collection information is data encrypted through a second public key, and the second public key is transmitted to the server by the mobile terminal when the network is available;
decrypting the collection information with a second private key, wherein the second public key and the second private key are a key pair;
displaying according to the decrypted collection information for user confirmation;
and if the confirmation operation of the collection information is received, feeding back the confirmation information to the collection equipment through the direct connection so as to be used for indicating the collection equipment to forward the confirmation information to the server, wherein the confirmation information is used for indicating the server to pay deduction.
2. The method of claim 1, wherein the feeding back confirmation information to the collection device via the direct connection if a confirmation operation of the collection information is received comprises:
if a confirmation operation of the collection information is received, recording a time stamp of the confirmation operation;
and sending the timestamp and the confirmation information to the collection device through the direct connection, so as to judge whether the confirmation information is valid or not according to the timestamp through a forwarding indication server of the collection device.
3. The method of claim 1, wherein the feeding back confirmation information to the checkout device via the direct connection comprises:
after the confirmation information is encrypted through the first public key, the confirmation information is sent to the collection device through the direct connection and used for forwarding the confirmation information through the collection device, and the server is instructed to decrypt the confirmation information through the first private key.
4. The method of any of claims 1-3, wherein the establishing a direct connection with the checkout device based on a short-range wireless communication technology comprises:
providing identification information for establishing a direct connection based on a short-range wireless communication technology, wherein the identification information is used for enabling the collection device to establish the direct connection based on the short-range wireless communication technology with the mobile terminal according to the identification information;
a direct connection is established with the checkout device.
5. The method of claim 4, wherein providing identification information for direct connection based on short-range wireless communication technology comprises:
and generating a two-dimensional code of the coded information comprising the identification information.
6. A method according to any of claims 1-3, characterized in that the direct connection based on short-range wireless communication technology is a bluetooth connection.
7. An offline payment method, characterized by being applied to a collection device, the method comprising:
under the condition that the mobile terminal is in a payment state and the network of the mobile terminal is unavailable, establishing direct connection with the mobile terminal based on a short-distance wireless communication technology, wherein the network unavailability of the mobile terminal characterizes that the network connection of the mobile terminal fails, the network connected with the mobile terminal cannot transmit and receive data, or the current used flow of a mobile data network account corresponding to the mobile terminal exceeds a highest flow threshold under the condition that the mobile terminal is connected with a mobile data network;
receiving a data packet sent by the mobile terminal, wherein the data packet is obtained by encrypting and packaging payment account information by the mobile terminal by using a first public key, a head destination address in the data packet is packaged as an address of a server, a source address is packaged as a blank, the mobile terminal stores the first public key acquired from the server when a network is available, the first public key and a first private key are a key pair, and the encryption mode of the payment account information is a mode that the collection equipment cannot decrypt and the server can decrypt;
Transmitting the payment account information and the collection information to a server to instruct the server to decrypt the payment account information with the first private key;
receiving the collection information sent by the server, wherein the collection information is data encrypted through a second public key, and the second public key is sent to the server by the mobile terminal when the network is available;
sending the receipt information to the mobile terminal through the direct connection;
receiving confirmation information which is fed back by the mobile terminal through the direct connection and is based on the collection information, wherein the confirmation information is obtained by the user inputting confirmation operation based on the displayed collection information after the mobile terminal decrypts the collection information through a second private key and displays the decrypted collection information, and the second public key and the second private key are a key pair;
and forwarding the confirmation information to the server, wherein the confirmation information is used for indicating the server to pay deduction.
8. The method of claim 7, wherein the payment account information received is encrypted and encapsulated in a data packet,
the sending the payment account information and the collection information to a server includes:
Unpacking the data packet to obtain the address of the server and the encrypted payment account information;
and packaging the encrypted payment account information and the collection information into a data packet and then sending the data packet to a server, wherein a destination address in the data packet is packaged into an address of the server obtained from the unpacked data packet, and a source address is an address of the collection device.
9. An offline payment method, characterized by being applied to a server, the method comprising:
receiving payment account information and collection information sent by collection equipment, wherein the payment account information is a data packet sent to the collection equipment by a mobile terminal after the mobile terminal establishes direct connection with the collection equipment based on a short-distance wireless communication technology under the condition that the mobile terminal is in a payment state and a network of the mobile terminal is unavailable, and the data packet is obtained by encrypting and packaging the payment account information by using a first public key, wherein a head destination address in the data packet is packaged as an address of a server, a source address is packaged as null, the mobile terminal stores the first public key acquired from the server when the network is available, the first public key and a first private key are a key pair, and the encryption mode of the payment account information is a mode that the collection equipment cannot decrypt and the server can decrypt;
Decrypting the payment account information with a first private key, wherein the first private key and the first public key are a key pair;
encrypting the collection information through a second public key and sending the second public key to the collection device, wherein the second public key is used for indicating the collection device to forward the encrypted collection information to a mobile terminal, and the second public key is sent to the server by the mobile terminal when the network is available;
receiving confirmation information sent by the collection equipment, wherein the confirmation information is obtained by a user inputting confirmation operation based on the displayed decrypted collection information after the mobile terminal decrypts the collection information through a second private key and displays the decrypted collection information, and the second public key and the second private key are a key pair;
and if the confirmation information is valid, deducting money according to the collection information and the decrypted payment account information.
10. An offline payment device, characterized in that it is applied to a mobile terminal, said device comprising:
the network confirming module is used for determining whether the network of the mobile terminal is available in a payment state;
the direct connection module is used for determining that the network is unavailable if the mobile terminal fails to connect with the network, the network connected with the mobile terminal cannot transmit and receive data, or the current used flow of the mobile data network account corresponding to the mobile terminal exceeds the highest flow threshold value under the condition that the mobile terminal is connected with the mobile data network, and establishing direct connection with the collection device based on a short-distance wireless communication technology;
The information sending module is used for encrypting the payment account information through a first public key and then packaging the payment account information into a data packet, wherein a head destination address in the data packet is packaged into an address of a server, a source address is packaged into an empty state, the mobile terminal stores the first public key acquired from the server when a network is available, the first public key and a first private key are a key pair, and the encryption mode of the payment account information is a mode that the collection equipment cannot decrypt and the server can decrypt; the data packet is sent to the collection device through the direct connection, so that the collection device is instructed to send the payment account information and the collection information to a server for deduction, and the server is instructed to decrypt the payment account information through the first private key through forwarding of the collection device; receiving the collection information transmitted to the collection device by the server and forwarded by the collection device through the direct connection, wherein the collection information is data encrypted through a second public key, and the second public key is transmitted to the server by the mobile terminal when the network is available; decrypting the collection information with a second private key, wherein the second public key and the second private key are a key pair; displaying according to the decrypted collection information for user confirmation; and if the confirmation operation of the collection information is received, feeding back the confirmation information to the collection equipment through the direct connection so as to be used for indicating the collection equipment to forward the confirmation information to the server, wherein the confirmation information is used for indicating the server to pay deduction.
11. An offline payment device, characterized in that it is applied to a collection device, said device comprising:
the mobile terminal comprises a direct connection module, a short-distance wireless communication module and a data transmission module, wherein the direct connection module is used for establishing direct connection with a mobile terminal based on a short-distance wireless communication technology when the mobile terminal is in a payment state and the network of the mobile terminal is unavailable, the network of the mobile terminal is unavailable to represent network connection failure of the mobile terminal, the network connected with the mobile terminal cannot transmit and receive data, or the current used flow of a mobile data network account corresponding to the mobile terminal exceeds a highest flow threshold when the mobile terminal is connected with a mobile data network;
the information receiving module is used for receiving a data packet sent by the mobile terminal, wherein the data packet is obtained by encrypting and packaging payment account information by the mobile terminal through a first public key, a head destination address in the data packet is packaged as an address of a server, a source address is packaged as a null, the mobile terminal stores the first public key acquired from the server when a network is available, the first public key and a first private key are a key pair, and the encryption mode of the payment account information is a mode that the collection equipment cannot decrypt and the server can decrypt;
The information sending module is used for sending the payment account information and the collection information to a server so as to instruct the server to decrypt the payment account information through the first private key; receiving the collection information sent by the server, wherein the collection information is data encrypted through a second public key, and the second public key is sent to the server by the mobile terminal when the network is available; sending the receipt information to the mobile terminal through the direct connection; receiving confirmation information which is fed back by the mobile terminal through the direct connection and is based on the collection information, wherein the confirmation information is obtained by the user inputting confirmation operation based on the displayed collection information after the mobile terminal decrypts the collection information through a second private key and displays the decrypted collection information, and the second public key and the second private key are a key pair; and forwarding the confirmation information to the server, wherein the confirmation information is used for indicating the server to pay deduction.
12. An offline payment device, characterized by being applied to a server, said device comprising:
the information receiving module is used for receiving payment account information and collection information sent by collection equipment, wherein the payment account information is a data packet which is sent to the collection equipment by the mobile terminal after the mobile terminal is directly connected with the collection equipment based on a short-distance wireless communication technology under the condition that the mobile terminal is in a payment state and a network of the mobile terminal is unavailable, the data packet is obtained by encrypting and packaging the payment account information by using a first public key, a head destination address in the data packet is packaged as an address of the server, a source address is packaged as an empty address, the mobile terminal stores the first public key acquired from the server when the network is available, the first public key and a first private key are a key pair, and the encryption mode of the payment account information is a mode that the collection equipment cannot decrypt and the server can decrypt;
The decryption module is used for decrypting the payment account information through a first private key, wherein the first private key and the first public key are a key pair;
the payment deduction module is used for encrypting the collection information through a second public key and sending the collection information to the collection equipment, so as to instruct the collection equipment to forward the encrypted collection information to the mobile terminal, and the second public key is sent to the server by the mobile terminal when the network is available; receiving confirmation information sent by the collection equipment, wherein the confirmation information is obtained by a user inputting confirmation operation based on the displayed decrypted collection information after the mobile terminal decrypts the collection information through a second private key and displays the decrypted collection information, and the second public key and the second private key are a key pair; and if the confirmation information is valid, deducting money according to the collection information and the decrypted payment account information.
13. An electronic device, comprising:
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 configured to perform the method of any of claims 1-9.
14. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a program code, which is callable by a processor for performing the method according to any one of claims 1-9.
CN201980091192.2A 2019-05-08 2019-05-08 Offline payment method and device, electronic equipment and storage medium Active CN113383356B (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/086042 WO2020223932A1 (en) 2019-05-08 2019-05-08 Offline payment method and apparatus, electronic device, and storage medium

Publications (2)

Publication Number Publication Date
CN113383356A CN113383356A (en) 2021-09-10
CN113383356B true CN113383356B (en) 2024-04-02

Family

ID=73050512

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201980091192.2A Active CN113383356B (en) 2019-05-08 2019-05-08 Offline payment method and device, electronic equipment and storage medium

Country Status (2)

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

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115760105A (en) * 2021-09-03 2023-03-07 浙江网商银行股份有限公司 Task processing system, method and device
CN117196613B (en) * 2023-09-21 2024-03-15 北京小懂科技有限公司 Offline charging method, offline charging device, computer equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105550860A (en) * 2015-12-11 2016-05-04 小米科技有限责任公司 Payment method and device
WO2016206385A1 (en) * 2015-06-25 2016-12-29 深圳市中兴微电子技术有限公司 Payment method, device and system, and computer storage medium
CN206312224U (en) * 2016-09-23 2017-07-07 深圳市微付充科技有限公司 Payment system
CN107665427A (en) * 2017-08-22 2018-02-06 阿里巴巴集团控股有限公司 A kind of offline electronic payment, business processing, the method and device of payment processes
CN107944857A (en) * 2017-10-31 2018-04-20 阿里巴巴集团控股有限公司 A kind of method and device of paying riding fee

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104936128A (en) * 2014-12-08 2015-09-23 深圳市腾讯计算机系统有限公司 Off-line data transfer method, device and system
CN109146470B (en) * 2018-08-24 2023-02-28 北京小米移动软件有限公司 Method and device for generating payment code

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016206385A1 (en) * 2015-06-25 2016-12-29 深圳市中兴微电子技术有限公司 Payment method, device and system, and computer storage medium
CN105550860A (en) * 2015-12-11 2016-05-04 小米科技有限责任公司 Payment method and device
CN206312224U (en) * 2016-09-23 2017-07-07 深圳市微付充科技有限公司 Payment system
CN107665427A (en) * 2017-08-22 2018-02-06 阿里巴巴集团控股有限公司 A kind of offline electronic payment, business processing, the method and device of payment processes
CN107944857A (en) * 2017-10-31 2018-04-20 阿里巴巴集团控股有限公司 A kind of method and device of paying riding fee

Also Published As

Publication number Publication date
CN113383356A (en) 2021-09-10
WO2020223932A1 (en) 2020-11-12

Similar Documents

Publication Publication Date Title
KR102364874B1 (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
EP2735182B1 (en) Security gateway communication
EP3637814B1 (en) Communication device, control method for communication device and program
JP6228690B2 (en) Communication method between mobile terminal and POS terminal, communication system and POS terminal
KR101820392B1 (en) Method, device and system for establishing data connection
RU2606057C1 (en) Method and device for receiving commodity, as well as wireless terminal for receiving
CN113383356B (en) Offline payment method and device, electronic equipment and storage medium
US10404475B2 (en) Method and system for establishing a secure communication tunnel
CN110519274B (en) Block chain information transmission method, device, equipment and storage medium
CN112686358A (en) Data transmission method, NFC electronic tag, terminal device and storage medium
CN113169867B (en) Information transmitting/receiving method using QR code
CN110493455B (en) Equipment control method and device and mobile terminal
CN108932619B (en) Terminal offline charging service method and system
CN105634561B (en) A kind of information interacting method and device
CN113596827B (en) Key generation method, device, electronic equipment and storage medium
CN107172718B (en) Information processing method and electronic equipment
CN112350768A (en) Beidou short message receiving and transmitting device with wireless communication function
CN112041897A (en) Control method, ticket selling rule server, ticket checking rule server and device
KR101132361B1 (en) Method and system for transferring data with improved security
CN113193923B (en) Remote testing method, equipment and system
KR20110120411A (en) Method and system for generating security data using external electronic device
CN117835369A (en) Network connection method, related device and computer readable storage medium
KR101592070B1 (en) Method for Security Relaying by using Code Image
CN114693292A (en) Payment method, payment device, electronic equipment and computer-readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant