CN112541761B - Method and device for generating and scanning offline payment code and scanning device - Google Patents

Method and device for generating and scanning offline payment code and scanning device Download PDF

Info

Publication number
CN112541761B
CN112541761B CN202011432975.3A CN202011432975A CN112541761B CN 112541761 B CN112541761 B CN 112541761B CN 202011432975 A CN202011432975 A CN 202011432975A CN 112541761 B CN112541761 B CN 112541761B
Authority
CN
China
Prior art keywords
payment
information
code
target
offline
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
CN202011432975.3A
Other languages
Chinese (zh)
Other versions
CN112541761A (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.)
Shenzhen Kftpay Finance Network Technology Service Co ltd
Original Assignee
Shenzhen Kftpay Finance Network Technology Service 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 Shenzhen Kftpay Finance Network Technology Service Co ltd filed Critical Shenzhen Kftpay Finance Network Technology Service Co ltd
Priority to CN202011432975.3A priority Critical patent/CN112541761B/en
Publication of CN112541761A publication Critical patent/CN112541761A/en
Application granted granted Critical
Publication of CN112541761B publication Critical patent/CN112541761B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3821Electronic credentials
    • G06Q20/38215Use of certificates or encrypted proofs of transaction rights
    • 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
    • G06Q20/327Short range or proximity payments by means of M-devices
    • G06Q20/3276Short range or proximity payments by means of M-devices using a pictured code, e.g. barcode or QR-code, being read by the M-device
    • 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/38Payment protocols; Details thereof
    • G06Q20/40Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
    • G06Q20/401Transaction verification

Landscapes

  • Business, Economics & Management (AREA)
  • Engineering & Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Finance (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Cash Registers Or Receiving Machines (AREA)

Abstract

The application discloses a method, a device and a device for generating and scanning an offline payment code, wherein the method for generating the offline payment code comprises the following steps: when a request for acquiring an offline payment code based on a user trigger operation on a terminal interface is received, acquiring a target bar code fed back by a server and used for generating the offline payment code; acquiring bar code information and trigger information of the target bar code, and acquiring a dynamic password based on the trigger information; and generating the off-line payment code according to the bar code information, the dynamic password and the transaction information. The technical problem that the transaction cannot be safely carried out due to the fact that the payment code is leaked in the prior art in the off-line payment is solved, and the safety of the off-line payment is improved.

Description

Method and device for generating and scanning offline payment code and scanning device
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method, an apparatus, and a system for generating and scanning an offline payment code.
Background
The payment code function is widely applied in life along with the development of communication technology, and great convenience is brought to the life of people. When people use online payment to complete payment, the server can generate a new payment code in real time by controlling the power and the like after receiving a request for acquiring the payment code sent by the client, so that the risk of client forgery is avoided, and the safety is high. However, in the process of completing payment by people using an online payment method, the operation of the network is unstable frequently, and therefore, an offline payment method is provided.
In off-line payment, the effective time of the payment code is short in terms of security, and in order to generate an effective off-line payment code, the off-line payment code for payment is generally generated according to the card number and the payment password, but the card number and the payment password are usually fixed within a certain period, are easy to leak, and are not beneficial to ensuring the security of the off-line payment.
Disclosure of Invention
The embodiment of the application aims to reduce the risk that the offline payment code is stolen in the process of payment by using the offline payment code, so that the security of offline payment is ensured.
In order to achieve the above object, an aspect of the present application provides a method for generating an offline payment code, including:
when a request for acquiring an offline payment code based on a user trigger operation on a terminal interface is received, acquiring a target bar code fed back by a server and used for generating the offline payment code;
acquiring bar code information and trigger information of the target bar code, and acquiring a dynamic password based on the trigger information;
and generating the off-line payment code according to the bar code information, the dynamic password and the transaction information.
Optionally, the transaction information includes payment platform information and payment mode information, and the step of generating the offline payment code according to the barcode information, the dynamic password and the transaction information includes:
executing target algorithm operation on the bar code information, the dynamic password and the payment mode information to generate a target payment mark;
and connecting the target payment mark and the payment platform information to generate the offline payment code.
Optionally, the target algorithm includes a first target algorithm and a second target algorithm, and the step of executing a target algorithm operation on the barcode information, the dynamic password and the payment method information to generate a target payment token includes:
acquiring a first factor, a second factor and a third factor respectively corresponding to the bar code information, the dynamic password and the payment mode information in the first target algorithm;
performing product operation on the bar code information, the dynamic password and the payment mode information based on the first factor, the second factor and the third factor, and obtaining an addition result of the product operation to obtain a first payment mark;
and executing a second target algorithm operation according to the first payment mark to generate the target payment mark.
Optionally, the step of performing a second target algorithm operation according to the first payment token to generate the target payment token comprises:
splitting the first payment mark according to the character length of the first payment mark to obtain a first sub-payment mark and a second sub-payment mark;
carrying out XOR operation on the first sub payment mark and the second sub payment mark to obtain a third payment mark;
and connecting the third payment mark and the second sub payment mark to obtain the target payment mark.
Optionally, the acquiring the barcode information and the trigger information of the target barcode and before the step of acquiring the dynamic password based on the trigger information, includes:
detecting whether the time for storing the target bar code information is less than a preset time;
and if the preset time length is less than the preset time length, executing the step of acquiring a dynamic password based on the trigger information according to the acquired bar code information and the trigger information of the target bar code.
Optionally, the step of acquiring barcode information and trigger information of the target barcode includes:
acquiring identification information of terminal equipment;
and executing decryption operation on the target bar code information according to the identification information to obtain the bar code information and the trigger information.
In addition, in order to achieve the above object, another aspect of the present application further provides a method for scanning an offline payment code, where the method for scanning an offline payment code includes:
scanning the offline payment code;
and sending the offline payment code to a server side so that the server side verifies the received offline payment code.
Optionally, after the step of sending the offline payment code to the server, the method includes:
and receiving a verification result sent by the server side, and obtaining the payment condition of the user according to the verification result.
In addition, to achieve the above object, another aspect of the present application further provides an offline payment code generation apparatus, including:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a target bar code which is fed back by a server and used for generating an offline payment code when receiving a request of acquiring the offline payment code by a terminal interface based on a user triggering operation;
the trigger module is used for acquiring bar code information and trigger information of the target bar code and acquiring a dynamic password based on the trigger information;
and the generating module is used for generating the offline payment code according to the bar code information, the dynamic password and the transaction information.
In addition, to achieve the above object, another aspect of the present application further provides an apparatus for scanning an offline payment code, where the apparatus for scanning an offline payment code includes:
the scanning module is used for scanning the offline payment code;
and the sending module is used for sending the offline payment code to the server so that the server verifies the received offline payment code.
In this embodiment, when a request for acquiring an offline payment code by a trigger operation of a terminal interface user is received when the terminal device is in a no-network state or a network operation environment cannot normally execute the acquisition of the online payment code, a target barcode of the terminal device, which is stored by an acquisition server when the network operation environment of the terminal device is normal and used for generating the offline payment code, is acquired, barcode information and trigger information of the target barcode are acquired, a dynamic password is acquired based on the acquired trigger information, and the offline payment code is generated according to the barcode information, the dynamic password and transaction information. The payment information of the off-line payment code can be changed in real time by acquiring the dynamic password, so that the off-line payment code of the user is prevented from being illegally stolen for transferring accounts, and the payment safety of the user is ensured.
Drawings
Fig. 1 is a schematic terminal structure diagram of a hardware operating environment according to an embodiment of the present application;
FIG. 2 is a schematic flowchart illustrating an embodiment of a method for generating an offline payment code according to the present application;
FIG. 3 is a schematic flowchart illustrating a method for generating an offline payment code according to another embodiment of the present application;
FIG. 4 is a schematic flowchart illustrating a method for generating an offline payment code according to another embodiment of the present application;
FIG. 5 is a schematic flowchart of an embodiment of a method for collecting code-scanning data according to the present application;
FIG. 6 is a functional block diagram of an apparatus for generating an offline payment code according to the present application;
fig. 7 is a functional block diagram of the code scanning and collecting device according to the present application.
The implementation, functional features and advantages of the objectives of the present application will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The main solution of the embodiment of the application is as follows: when a request for acquiring an offline payment code based on a user trigger operation on a terminal interface is received, acquiring a target bar code fed back by a server and used for generating the offline payment code; acquiring bar code information and trigger information of the target bar code, and acquiring a dynamic password based on the trigger information; and generating the off-line payment code according to the bar code information, the dynamic password and the transaction information.
Because the existing offline payment code is generated according to the bank card account number and the payment password of the user, the bank card account number and the payment password of the user cannot be replaced in a short time, if the bank card or the payment password of the user is easily revealed in the using process of the user, the risk that the offline payment code is stolen by lawbreakers exists in the offline transaction process, and the property safety of the user is threatened.
As shown in fig. 1, fig. 1 is a schematic terminal structure diagram of a hardware operating environment according to an embodiment of the present application.
As shown in fig. 1, the terminal may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Optionally, the terminal may further include a camera, a Radio Frequency (RF) circuit, a sensor, a remote controller, an audio circuit, a WiFi module, a detector, and the like. Of course, the terminal may also be configured with other sensors such as a gyroscope, a barometer, a hygrometer and a temperature sensor, which are not described herein again.
Those skilled in the art will appreciate that the terminal structure shown in fig. 1 does not constitute a limitation of the terminal device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a kind of computer-readable storage medium, may include therein an operating system, a network communication module, a user interface module, and an offline payment code generation program.
In the terminal shown in fig. 1, the network interface 1004 is mainly used for connecting to a backend server and performing data communication with the backend server; the user interface 1003 is mainly used for connecting a client (user side) and performing data communication with the client; and the processor 1001 may be configured to call the generation program of the offline payment code stored in the memory 1005, and perform the following operations:
when a request for acquiring an offline payment code based on a user trigger operation on a terminal interface is received, acquiring a target bar code fed back by a server and used for generating the offline payment code;
acquiring bar code information and trigger information of the target bar code, and acquiring a dynamic password based on the trigger information;
and generating the off-line payment code according to the bar code information, the dynamic password and the transaction information.
Referring to fig. 2, fig. 2 is a schematic flowchart illustrating an embodiment of a method for generating an offline payment code according to the present application.
Embodiments of the present application provide an embodiment of a method for generating an offline payment code, and it should be noted that although a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in an order different from that here.
The method for generating the offline payment code comprises the following steps:
step S10, when a request for acquiring an offline payment code based on a user trigger operation is received on a terminal interface, acquiring a target bar code fed back by a server and used for generating the offline payment code;
the terminal interface is an interface of terminal equipment, and the terminal equipment is a mobile phone, an intelligent electronic watch, a Pad and the like which can generate payment codes according to the touch of a received user, operate and analyze the current network environment condition and further display different types of payment codes. In the application, the terminal equipment can analyze the current network environment condition, and when the terminal equipment detects that a user triggers to acquire the payment code under the network environment that the terminal equipment can normally execute online acquisition of the payment code, the online payment code is acquired; and under the condition that the payment code cannot be acquired online, such as the condition that the terminal equipment is in a network-free state or the condition that data transmission cannot be carried out during network operation, the operation of generating the offline payment code is executed when the user triggers the acquisition of the payment code.
The target bar code is sent to the terminal equipment when the server side receives the bar code which is sent from the terminal equipment and used for acquiring and generating the offline payment code. The method comprises the steps that the terminal equipment sends an instruction for acquiring a target bar code to a server under the condition that network condition operation can normally execute data transmission, and stores the target bar code sent by the server on a terminal equipment storage after receiving feedback information of the server, so that when the network environment of the terminal equipment cannot carry out normal communication, the target bar code is acquired after a trigger operation that a user acquires a payment code by clicking a terminal interface is acquired.
Step S20, acquiring bar code information and trigger information of the target bar code, and acquiring a dynamic password based on the trigger information;
the bar code information is generated in the target bar code according to the identification information of the terminal equipment. The trigger information is used to generate an OTP (one time password, or one time passcode, dynamic password) used to generate a payment code for one transaction. Specifically, the trigger information may be a seed token, and when the terminal device receives the seed token, the dynamic password is generated by obtaining a specific number of the seed token and a current time. The dynamic password is part of the off-line payment code.
The step of acquiring the barcode information and the trigger information of the target barcode comprises the following steps:
step S21, acquiring identification information of the terminal equipment;
step S22, performing a decryption operation on the target barcode information according to the identification information to obtain the barcode information and the trigger information.
When the terminal equipment sends the target bar code, the target bar code corresponding to the identification information is sent according to the received identification information of the terminal, and the target bar code is encrypted by the identification information. The identification information is information for uniquely identifying the terminal device, such as ID information of the terminal device, and further sends the target barcode information subjected to the encryption operation to the terminal device through the identification information.
And when receiving the target bar code subjected to the encryption operation, the terminal equipment decrypts the target bar code to obtain the bar code information and the trigger information of the target bar code.
In this embodiment, when receiving the generation information of the terminal device for acquiring the offline code, the server analyzes the identification information of the terminal device to further acquire the target barcode corresponding to the identification information of the terminal device, and can encrypt the target barcode according to the identification information, thereby further ensuring the accuracy and the security of the terminal barcode.
And step S30, generating the offline payment code according to the bar code information, the dynamic password and the transaction information.
After the dynamic code is acquired according to the starting information, the terminal equipment generates an offline payment code according to the acquired bar code information, the dynamic password and the current transaction information. The transaction information comprises payment mode information and payment platform information, wherein the payment platform information is a payment platform selected by a user, such as WeChat, Paibao and the like; the payment method information is information on the settlement method of the electronic money used for payment, such as the electronic money charged on the payment platform, the electronic money paid by the bank card, the postal payment, or the like.
In this embodiment, the payment platform information may be determined according to an application program clicked by a user after receiving an operation of clicking payment by the user, for example, when the user clicks a payment code of a payment bank on line under a network condition, and when an offline payment code is generated, the obtained platform information is a number (WeChat 01, Payment bank 02) of the offline payment code corresponding to the payment bank, and the payment platform information in the generated offline payment code is determined to be 02.
The payment method is the default payment method (change 11, middle line card 12, build line card 13) checked by the user. For example, if the user selects the default payment method to be the middle bank card payment, the payment method information in the offline two-dimensional code is 12.
In this embodiment, when a request for acquiring an offline payment code by a trigger operation of a terminal interface user is received when the terminal device is in a no-network state or a network operation environment cannot normally execute the acquisition of the online payment code, a target barcode of the terminal device, which is stored by an acquisition server when the network operation environment of the terminal device is normal and used for generating the offline payment code, is acquired, barcode information and trigger information of the target barcode are acquired, a dynamic password is acquired based on the acquired trigger information, and the offline payment code is generated according to the barcode information, the dynamic password and transaction information. The payment information of the off-line payment code can be changed in real time by acquiring the dynamic password, so that the off-line payment code of the user is prevented from being illegally stolen for transferring accounts, and the payment safety of the user is ensured.
Further, referring to fig. 3, another embodiment of the method for generating an offline payment code of the present application is provided.
The difference between this embodiment and the previous embodiment is that the transaction information includes payment platform information and payment method information, and the step of generating the offline payment code according to the barcode information, the dynamic password, and the transaction information includes:
step S31, executing target algorithm operation on the bar code information, the dynamic password and the payment mode information to generate a target payment mark;
and step S32, connecting the target payment mark and the payment platform information to generate the offline payment code.
The target algorithm is an instruction for executing the bar code information, the dynamic password and the payment mode information according to a preset rule. The target payment mark is digital information formed after the bar code information, the dynamic password and the payment mark are subjected to target algorithm operation. The target algorithm can be to perform addition and subtraction operations in the bar code information, the dynamic password and the payment information. For example, the barcode information, the dynamic password, and the payment means information are added.
In the embodiment, after the dynamic password is acquired, the effective time of the dynamic password is set (30S), and the dynamic password, the bar code information and the payment mode are executed with a target algorithm operation within the effective time of the dynamic password to generate a target payment code. And then performing connection operation on the target payment code and the platform information to generate an offline payment code.
In the embodiment, the target algorithm operation is executed on the bar code information, the dynamic password and the payment information through the target algorithm operation, and the bar code information, the dynamic password and the payment information are protected according to the target algorithm, so that the risk that the bar code information and the dynamic password are stolen because the bar code information, the dynamic password, the payment mode information and the payment platform information are directly executed with connection operation is reduced.
The target algorithm comprises a first target algorithm and a second target algorithm, and the step of executing target algorithm operation on the bar code information, the dynamic password and the payment mode information to generate a target payment mark comprises the following steps:
step S311, acquiring a first factor, a second factor and a third factor corresponding to the barcode information, the dynamic password and the payment mode information in the first target algorithm respectively;
step S312, executing product operation to the bar code information, the dynamic password and the payment mode information based on the first factor, the second factor and the third factor, and obtaining an addition result of the product operation to obtain a first payment sign;
step S313, executing a second target algorithm operation according to the first payment sign to generate the target payment sign.
The first factor is a factor of executing a first target algorithm on bar code information in the target algorithm; the second factor is a factor of executing the first target algorithm on the dynamic password in the target algorithm; the third factor is a factor of executing the first target algorithm on the payment mode information in the target algorithm.
Specifically, in the following operation distance of the first target algorithm in this embodiment, the first factor may be 99 × 999999, the second factor is 1, the third factor is 999999, the obtained barcode information is 12345678, the dynamic password is 678910, and the payment method is 23, when the first target algorithm is executed, the process of obtaining a specific result is as follows: the first payment sign is bar code information, a first factor, a dynamic password, a second factor and payment mode information, and a third factor. The first payment token operates according to the first target algorithm to yield 12345678 999999+678910 1+23 999999-121023668965. And then executing the result (the first payment mark) of the first target algorithm operation to obtain a target payment mark of a second target algorithm operation.
In the embodiment, by performing a first target algorithm operation on the bar code information, the dynamic password and the payment information, the number of digits of the mark code at the time of generating the first payment mark is controlled in a different manner of controlling the execution of each factor in the first target algorithm mark, so as to perform consistency in performing a second target algorithm operation on the target generated code. Meanwhile, the digit of the offline payment code is ensured to be generated.
The step of performing a second target algorithm operation according to the first payment token to generate the target payment token comprises an exclusive or operation and a join operation, and comprises:
step S3131, splitting the first payment mark according to the character length of the first payment mark to obtain a first sub-payment mark and a second sub-payment mark;
step S3132, performing an exclusive or operation on the first sub payment token and the second sub payment token to obtain a third payment token;
step S3133, connecting the third payment token and the second sub payment token to obtain the target payment token.
In this embodiment, the second target algorithm operation is further executed by the result of executing the first target algorithm operation when executing the second target algorithm operation. The second target algorithm operation is a result of target operation of the first payment token.
The specific calculation process of the second target algorithm is as follows: the method comprises the steps of obtaining the character length of a first payment mark, splitting the first payment mark according to the character length to obtain a first payment mark and a second payment mark, and then conducting exclusive-or operation on a first sub-payment mark and a second sub-payment mark to obtain a third payment mark. For example, when the character length of the acquired payment tag is 16 bits when the first payment tag is 1222220923456765, the first sub-payment tag is 12222209 and the second sub-payment tag is 23456765. Performing XOR (1^2, 2^3,2^4,2^5, …, 9^5) bit by bit results in the third payment flag 31674565. The specific process of the exclusive-or operation is as follows: converting the first digit 1 of the first sub payment mark into binary to obtain 01, converting the first digit 2 of the second sub payment mark into binary 10, performing exclusive-or operation on the first digit (01) of the first sub payment mark after being converted into binary and the first digit (10) of the second sub payment mark after being converted into binary according to digits, namely 0& 1-1, 1& 0-1 to obtain the result of exclusive-or operation 11, converting the binary (11) into decimal to obtain the result of exclusive-or operation on the first digit of the first sub payment mark and the first digit of the second sub payment mark as 3, and so on, sequentially obtaining the result 31674565 of exclusive-or operation on the first sub payment mark and the second sub payment mark as a third payment mark. The third payment token and the second sub payment token are concatenated to obtain a target payment token (3167456523456765). The add payment platform information 02 forms an offline payment code when the offline payment code is generated (316745652345676502).
In this embodiment, a bitwise xor algorithm is used to perform an operation on the processed barcode information, the dynamic password and the payment mode information to obtain third payment information, and the third payment information is connected with the payment platform information to form an offline payment code. The security of the off-line payment code is further enhanced by an exclusive-or algorithm.
Further, referring to fig. 4, a method for generating an offline payment code according to another embodiment of the present application is provided.
The step of obtaining the bar code information and the trigger information of the target bar code based on the trigger information comprises the following steps:
step S01, detecting whether the time for storing the target bar code information is less than the preset time;
and step S02, if the preset time length is shorter than the preset time length, executing the step of acquiring the dynamic password based on the trigger information according to the bar code information and the trigger information of the acquired target bar code.
When the bar code information is acquired and the target bar code information is received, whether the time length of the target bar code information stored in the mobile phone is less than the preset time length or not is judged, and when the time length of the target bar code information stored in the mobile phone is less than the preset time length, the bar code information and the trigger information of the target bar code are acquired.
It can be understood that the terminal device sends the identification information of the terminal to the server at a preset time interval (24 hours), so that the server sends the target barcode to the terminal device according to the received terminal identification information, and updates the trigger information and the barcode information of the target barcode in time, thereby reducing the leakage risk of using the target barcode for a long time and ensuring the security of the barcode information and the trigger information.
Referring to fig. 5, the present application further provides a scanning method of an offline payment code, where the scanning method of the offline payment code includes:
step S10, scanning the off-line payment code;
step S20, sending the offline payment code to a server, so that the server verifies the received offline payment code.
The step of sending the offline payment code to the server so that the server verifies the received offline payment code comprises the following steps:
and step S30, receiving the verification result sent by the server, and obtaining the payment condition of the user according to the verification result.
A merchant may scan an offline payment code using a code scanning device, which may be a cell phone, Pad, code scanning gun, etc. After scanning the offline payment code, the code scanning device sends the scanned offline payment code to the server, so that the server acquires the bar code information and the dynamic password of the offline payment code, acquires the trigger information according to the bar code information, and compares the trigger information with the dynamic password, and then verifies whether the dynamic password is valid according to the acquired trigger information and the dynamic password and the generation rule of the OTP, when the dynamic password accords with the algorithm rule of the OTP, the scanned offline payment code is proved to be valid, the payment is carried out according to the bar code information, the payment mode information and the payment platform information in the offline payment code, and after the payment is finished, the payment success information is returned to the scanning device to inform the merchant that the current transaction is finished. And monitoring the network condition of the terminal equipment in real time, and sending the deduction information to the payment platform when the terminal equipment network can normally communicate so as to display the deduction information on an operation interface of the payment platform for a user to confirm the transaction information.
Further, in the embodiment, since whether the scanned offline payment code is a pure number or not can be identified, if not, it can be directly confirmed that the currently scanned offline payment code is not a valid offline payment code, and the offline payment code can be designed in a pure number manner, so that rapid scanning can be realized.
And when the scanning equipment confirms that the scanned offline payment code is the payment code of the current scanning platform, acquiring the offline payment code. And subtracting the code of the payment platform from the off-line payment code to obtain a target payment mark, and splitting the target payment mark in half to obtain bar code information, a dynamic password and a payment mode.
In the embodiment, the offline payment code is scanned, the obtained offline payment code executes decoding operation, and then payment is carried out according to the obtained bar code information, the dynamic password and the payment mode, so that the transaction is completed.
Referring to fig. 6, to implement the foregoing embodiment, the present application further provides an apparatus for generating an offline payment code, where the apparatus for generating an offline payment code includes:
the system comprises an acquisition module 10, a processing module and a processing module, wherein the acquisition module is used for acquiring a target bar code which is fed back by a server and is used for generating an offline payment code when receiving a request that a terminal interface acquires the offline payment code based on a trigger operation of a user;
the trigger module 20 is configured to acquire barcode information and trigger information of the target barcode, and acquire a dynamic password based on the trigger information;
and the generating module 30 is configured to generate the offline payment code according to the barcode information, the dynamic password and the transaction information.
Referring to fig. 7, in order to implement the foregoing embodiment, the present application further provides a scanning device for an offline payment code, where the scanning device for the offline payment code includes:
a scanning module 10, configured to scan the offline payment code;
the sending module 20 is configured to send the offline payment code to the server, so that the server verifies the received offline payment code.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It should be noted that in the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The application can be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
While alternative embodiments of the present application have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following appended claims be interpreted as including alternative embodiments and all such alterations and modifications as fall within the scope of the application.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (7)

1. A method for generating an offline payment code is characterized in that the method for generating the offline payment code comprises the following steps:
when a request for acquiring an offline payment code based on a user trigger operation on a terminal interface is received, acquiring a target bar code fed back by a server and used for generating the offline payment code;
acquiring bar code information and trigger information of the target bar code, and acquiring a dynamic password based on the trigger information;
acquiring a first factor, a second factor and a third factor respectively corresponding to the bar code information, the dynamic password and the payment mode information in a first target algorithm;
performing product operation on the bar code information, the dynamic password and the payment mode information based on the first factor, the second factor and the third factor, and obtaining an addition result of the product operation to obtain a first payment sign;
executing a second target algorithm operation according to the first payment mark to generate a target payment mark;
and connecting the target payment mark and the payment platform information to generate the offline payment code.
2. The method of generating an offline payment code according to claim 1, wherein said second target algorithm comprises an exclusive or operation and a join operation, and said step of executing a second target algorithm operation to generate said target payment token according to said first payment token comprises:
splitting the first payment mark according to the character length of the first payment mark to obtain a first sub-payment mark and a second sub-payment mark;
carrying out XOR operation on the first sub payment mark and the second sub payment mark to obtain a third payment mark;
and connecting the third payment mark and the second sub payment mark to obtain the target payment mark.
3. The method for generating an offline payment code according to claim 1, wherein said step of acquiring the barcode information and the trigger information of the target barcode, based on the trigger information, is preceded by the step of acquiring a dynamic password, comprising:
detecting whether the time for storing the target bar code information is less than a preset time;
and if the preset time length is less than the preset time length, executing the step of acquiring a dynamic password based on the trigger information according to the acquired bar code information and the trigger information of the target bar code.
4. The method for generating an offline payment code according to claim 1, wherein the step of acquiring the barcode information and the trigger information of the target barcode comprises:
acquiring identification information of terminal equipment;
and executing decryption operation on the target bar code information according to the identification information to obtain the bar code information and the trigger information.
5. The method for generating offline payment codes according to claim 1, applied to code scanning devices, comprises:
scanning the offline payment code;
and sending the offline payment code to a server side so that the server side verifies the received offline payment code.
6. The method for generating an offline payment code according to claim 5, wherein said step of sending said offline payment code to a server is followed by the steps of:
and receiving a verification result sent by the server side, and obtaining the payment condition of the user according to the verification result.
7. An offline payment code generation apparatus, characterized in that the offline payment code generation apparatus executes the offline payment code generation method according to claim 1.
CN202011432975.3A 2020-12-09 2020-12-09 Method and device for generating and scanning offline payment code and scanning device Active CN112541761B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011432975.3A CN112541761B (en) 2020-12-09 2020-12-09 Method and device for generating and scanning offline payment code and scanning device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011432975.3A CN112541761B (en) 2020-12-09 2020-12-09 Method and device for generating and scanning offline payment code and scanning device

Publications (2)

Publication Number Publication Date
CN112541761A CN112541761A (en) 2021-03-23
CN112541761B true CN112541761B (en) 2021-12-17

Family

ID=75019798

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011432975.3A Active CN112541761B (en) 2020-12-09 2020-12-09 Method and device for generating and scanning offline payment code and scanning device

Country Status (1)

Country Link
CN (1) CN112541761B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103218740A (en) * 2013-03-13 2013-07-24 北京宏基恒信科技有限责任公司 Trading system, method and device using two-dimension codes
CN104156859A (en) * 2014-08-28 2014-11-19 上海众人科技有限公司 Network transaction system and method based on dynamic passwords
CN104601332A (en) * 2015-01-26 2015-05-06 上海众人科技有限公司 Enhancement type dynamic two-dimensional code authentication system and authentication method thereof
CN104715370A (en) * 2013-12-12 2015-06-17 中国电信股份有限公司 Method and system for carrying out safety payment based on encrypted two-dimension code
CN107180351A (en) * 2017-04-13 2017-09-19 上海动联信息技术股份有限公司 A kind of off line Dynamic Two-dimensional code generating method, method of payment and equipment
CN107818463A (en) * 2017-09-25 2018-03-20 九派天下支付有限公司 A kind of offline electronic payment method and system based on TOTP algorithms
CN108416400A (en) * 2018-01-31 2018-08-17 杭州晟元数据安全技术股份有限公司 A kind of method of payment and payment system based on dynamic two-dimension code
WO2018198036A1 (en) * 2017-04-24 2018-11-01 Just Log Me S.R.L. Authentication system and identity management without password by single-use qr code and related method
CN109146470A (en) * 2018-08-24 2019-01-04 北京小米移动软件有限公司 Generate the method and device of payment code
CN110428036A (en) * 2019-07-11 2019-11-08 深圳市优博讯科技股份有限公司 A kind of generation method of dynamic two-dimension code, system and terminal device

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103218740A (en) * 2013-03-13 2013-07-24 北京宏基恒信科技有限责任公司 Trading system, method and device using two-dimension codes
CN104715370A (en) * 2013-12-12 2015-06-17 中国电信股份有限公司 Method and system for carrying out safety payment based on encrypted two-dimension code
CN104156859A (en) * 2014-08-28 2014-11-19 上海众人科技有限公司 Network transaction system and method based on dynamic passwords
CN104601332A (en) * 2015-01-26 2015-05-06 上海众人科技有限公司 Enhancement type dynamic two-dimensional code authentication system and authentication method thereof
CN107180351A (en) * 2017-04-13 2017-09-19 上海动联信息技术股份有限公司 A kind of off line Dynamic Two-dimensional code generating method, method of payment and equipment
WO2018198036A1 (en) * 2017-04-24 2018-11-01 Just Log Me S.R.L. Authentication system and identity management without password by single-use qr code and related method
CN107818463A (en) * 2017-09-25 2018-03-20 九派天下支付有限公司 A kind of offline electronic payment method and system based on TOTP algorithms
CN108416400A (en) * 2018-01-31 2018-08-17 杭州晟元数据安全技术股份有限公司 A kind of method of payment and payment system based on dynamic two-dimension code
CN109146470A (en) * 2018-08-24 2019-01-04 北京小米移动软件有限公司 Generate the method and device of payment code
CN110428036A (en) * 2019-07-11 2019-11-08 深圳市优博讯科技股份有限公司 A kind of generation method of dynamic two-dimension code, system and terminal device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
B2B中离线支付模式的"关系"学习博弈分析;杨洪涛等;《哈尔滨工程大学学报》;20100630;第31卷(第6期);791-796 *
Online banking system using Mobile-OTP with QR-code;Amandeep Choudhary等;《International Journal of Advanced Research in Computer and Communication Engineering》;20170430;第6卷(第4期);657-661 *

Also Published As

Publication number Publication date
CN112541761A (en) 2021-03-23

Similar Documents

Publication Publication Date Title
CN103856640B (en) Method and system for processing user resource information
CN104038924B (en) Realize the method and system of Resource Exchange information processing
RU2705019C2 (en) Method of detecting unauthorized access to software and notification thereof
US20070220597A1 (en) Verification system
CN105512881A (en) Method and terminal for completing payment on the basis of two-dimensional code
EP3816909A1 (en) Payment processing method for offline scenario, server, and readable storage medium
CN104169952A (en) Network payment method, device and system
CN101432980A (en) Time sync-type otp generation device and method for mobile phones
US9336523B2 (en) Managing a secure transaction
CN105915343B (en) A kind of offline Activiation method of registration user and system
CN103248495A (en) In-app paying method, server, client side and system
CN109376824A (en) Dynamic Two-dimensional code generating method and system
CN103873455A (en) Method and device for information check
CN106656993B (en) Dynamic verification code verification method and device
CN109120395A (en) Label data generation method, label and the data processing based on NFC label
CN110659899B (en) Offline payment method, device and equipment
CN103020815A (en) Method, device and system for processing payment transaction
CN111669744B (en) Information processing method and device and electronic equipment
CN105635164A (en) Method and device for security authentication
CN112541761B (en) Method and device for generating and scanning offline payment code and scanning device
KR101699032B1 (en) Service providing system and method for payment using electronic tag
WO2016123823A1 (en) Data interaction method, apparatus and system
US11257063B2 (en) Telephone call purchase with payment using mobile payment device
CN110544087A (en) Mobile payment method, device, equipment and computer readable storage medium
CN110659900B (en) Application-free payment method, device, medium and electronic equipment

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