CN110659899B - Offline payment method, device and equipment - Google Patents

Offline payment method, device and equipment Download PDF

Info

Publication number
CN110659899B
CN110659899B CN201910730712.1A CN201910730712A CN110659899B CN 110659899 B CN110659899 B CN 110659899B CN 201910730712 A CN201910730712 A CN 201910730712A CN 110659899 B CN110659899 B CN 110659899B
Authority
CN
China
Prior art keywords
payment
data
code
offline
time point
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
CN201910730712.1A
Other languages
Chinese (zh)
Other versions
CN110659899A (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 Huishang Tongying Technology Co ltd
Original Assignee
Shenzhen Huishang Tongying 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 Shenzhen Huishang Tongying Technology Co ltd filed Critical Shenzhen Huishang Tongying Technology Co ltd
Priority to CN201910730712.1A priority Critical patent/CN110659899B/en
Publication of CN110659899A publication Critical patent/CN110659899A/en
Application granted granted Critical
Publication of CN110659899B publication Critical patent/CN110659899B/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/3823Payment protocols; Details thereof insuring higher security of transaction combining multiple encryption tools for a transaction
    • 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/04Payment circuits
    • G06Q20/06Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme
    • G06Q20/065Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme using e-cash
    • G06Q20/0658Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme using e-cash e-cash managed locally
    • 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/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3829Payment protocols; Details thereof insuring higher security of transaction involving key management

Abstract

The application relates to an offline payment method, an offline payment device and offline payment equipment, wherein the offline payment method comprises the following steps: reading the encrypted payment data and the private key stored locally; decrypting the encrypted payment data through the private key to obtain original payment data; calculating according to the current time point to obtain verification data corresponding to the offline payment code; and generating an offline payment code for payment according to the verification data and the payment original data, and performing payment according to the offline payment code. The off-line payment code for payment is generated by the verification data and the original code, so that the safety of payment code storage is guaranteed, and the verification data is generated by the verification time point and the current time point, so that the timeliness safety of the payment code is guaranteed.

Description

Offline payment method, device and equipment
Technical Field
The application belongs to the field of mobile payment, and particularly relates to an offline payment method, device and equipment.
Background
With the popularization of mobile payment methods, more and more merchants accept mobile payment collection methods. The consumer can shop or enjoy the service through mobile payment on line, great convenience is brought to the consumer, and the trouble of receiving counterfeit money or making change can be avoided through the mobile payment mode of the merchant.
In the process of using the mobile payment, the user terminal may be interfered by the environment or have other communication faults, so that the user terminal cannot be connected to the network, and the effective time of the payment code is short in view of security, and in order to generate an effective offline payment code, the offline payment code for payment is generally generated according to the card number and the payment password, which is not beneficial to ensuring the security of offline payment.
Disclosure of Invention
In view of this, embodiments of the present application provide an offline payment method, apparatus, and device, so as to solve the problem that security of offline payment is not favorable to guarantee during offline payment in the prior art.
A first aspect of an embodiment of the present application provides an offline payment method, where the offline payment method includes:
reading the encrypted payment data and the private key stored locally;
decrypting the encrypted payment data through the private key to obtain payment original data;
calculating by using the current time point and a preset check time point to obtain check data corresponding to the offline payment code;
and generating an offline payment code for payment by applying the verification data and the payment original data.
With reference to the first aspect, in a first possible implementation manner of the first aspect, the step of obtaining, by applying the current time point and the verification time point, verification data corresponding to the offline payment code includes:
Calculating effective duration between the current time point and the verification time point;
and calculating to obtain the verification data by taking the effective duration as a parameter of a time correlation formula. .
With reference to the first possible implementation manner of the first aspect, in a second possible implementation manner of the first aspect, the step of calculating the parity bits by using the valid duration as a time correlation formula parameter includes:
determining corresponding calculation times N according to the effective duration, wherein N is a positive integer;
circularly calculating for N times according to a preset circular calculation formula to obtain a final calculation result;
intercepting one or more predetermined bits of the final calculation result as the check data.
With reference to the second possible implementation manner of the first aspect, in a third possible implementation manner of the first aspect, the step of calculating the parity bits by using the valid duration as a time correlation formula parameter includes:
determining corresponding calculation times N according to the effective duration, wherein N is a positive integer;
circularly calculating for N times according to a preset circular calculation formula to obtain a final calculation result;
intercepting one or more predetermined bits of the final calculation result as the check data.
With reference to the second possible implementation manner of the first aspect, in a third possible implementation manner of the first aspect, the loop calculation formula is Vn+1=μ×V n×(1-Vn) N is a positive integer, and N is a maximum value N, given μ and V1Value of (1), 0<V1<1,0<μ<4, and μ is not an integer.
With reference to the second possible implementation manner of the first aspect, in a fourth possible implementation manner of the first aspect, the determining, according to the effective duration, the corresponding number of times N of calculation includes:
acquiring preset unit time length;
and determining the calculation times N according to the ratio of the effective duration to the unit duration.
With reference to the first aspect, in a fifth possible implementation manner of the first aspect, the step of generating an offline payment code for payment by applying the verification data and the payment raw data includes:
splicing the verification data at a preset position of the payment original data according to a preset splicing rule to obtain offline payment data;
and coding the offline payment data through a preset coding rule to obtain an offline payment code.
In a second aspect, an embodiment of the present application provides an offline payment apparatus, including: the encrypted payment data reading unit is used for reading the encrypted payment data and the private key which are stored locally;
The payment original data acquisition unit is used for decrypting the encrypted payment data through the private key to obtain payment original data;
the verification data calculation unit is used for calculating to obtain verification data corresponding to the offline payment code by applying the current time point and a preset verification time point;
and the off-line payment code generating unit is used for generating an off-line payment code for payment by applying the verification data and the payment original data.
In a third aspect, an embodiment of the present application provides a payment terminal, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor, when executing the computer program, implements the steps of the offline payment method according to any one of the first aspect.
A fourth aspect of embodiments of the present application provides a computer-readable storage medium, having stored thereon a computer program, which, when executed by a processor, performs the steps of the offline payment method according to any one of the first aspects.
A fifth aspect of an embodiment of the present application provides an offline transaction system for implementing offline payment, including: at least one payment terminal, at least one collection terminal and payment cloud platform:
The payment terminal receives the encrypted payment data and the private key sent by the cloud platform, when the payment terminal is in an off-line state, the encrypted payment data is decrypted through the private key to obtain original payment data, verification data corresponding to an off-line payment code is obtained through calculation according to the original payment data and the current time point, and the off-line payment code for payment is generated according to the original payment data and the verification data;
the collection terminal reads the offline payment code of the payment terminal, sends the offline payment code to a payment cloud platform and responds to a verification message of offline payment sent by the payment cloud platform;
the payment cloud platform generates the asymmetric key pair, encrypts an original payment code through a public key to obtain encrypted payment data, verifies whether the offline payment code sent by the code scanning terminal is valid or not by combining the current time point, and sends a verification message of offline payment to the code scanning terminal.
Compared with the prior art, the embodiment of the application has the advantages that: the method comprises the steps of reading encrypted payment data and a private key which are stored locally, obtaining original payment data through decryption of the private key, calculating verification data of the offline payment code according to a current time point and a preset verification time point, and generating the offline payment code for payment through the verification data and the original payment data to carry out payment. The off-line encrypted payment data are decrypted through the private key, so that the security of the payment code storage is guaranteed, and the verification data are generated through the verification time point and the current time point, so that the timeliness security of the payment code is guaranteed.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic diagram of an offline payment system provided in an embodiment of the present application;
fig. 2 is a schematic flow chart of an implementation of an offline payment method provided in an embodiment of the present application;
fig. 3 is a schematic flow chart illustrating an implementation of a method for obtaining encrypted payment data according to an embodiment of the present application;
fig. 4 is a schematic flow chart illustrating an implementation of a method for calculating a parity bit according to an embodiment of the present application;
fig. 5 is a schematic flowchart of an implementation of a method for collecting payment from an offline payment terminal according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an offline payment apparatus according to an embodiment of the present application;
fig. 7 is a schematic diagram of a payment terminal provided in an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
In order to explain the technical solution described in the present application, the following description will be given by way of specific examples.
Fig. 1 is a schematic view of an offline payment system provided in an embodiment of the present application, where the offline payment system includes a collection terminal, a payment terminal, and a payment cloud platform, where:
the payment terminal can be a mobile payment terminal such as a smart phone and a tablet personal computer. The payment terminal can include a wireless communication module, and the wireless communication module can be a mobile communication module, such as a 4G communication module, a 5G communication module, and the like, and can also be a WIFI communication module. The payment terminal can communicate with the payment cloud platform through the wireless communication module. The payment terminal also comprises a display screen, and the display screen of the payment terminal can display a payment code for online payment or offline payment, so that the collection terminal executes collection operation according to the information in the collected payment code. The payment terminal is used for receiving the encrypted payment data sent by the payment cloud platform and a private key in the asymmetric key, decrypting the encrypted payment data through the private key to obtain original payment data, calculating verification data corresponding to an offline payment code according to the original payment data and the current time point, and generating the offline payment code for payment according to the original payment data and the verification data.
The collection terminal can analyze the acquired offline payment code locally or send the acquired offline payment code to a payment cloud platform for analysis. The method is combined to determine whether the offline payment code is valid. When the collection is effective, the collection terminal can return relevant collection information to the payment cloud platform, so that the payment cloud platform updates a payment record corresponding to a user account in the payment terminal according to the collection information. When the payment terminal recovers the network connection, the payment record can be updated to the payment terminal by the payment cloud platform. Or when the payment receiving terminal sends the offline payment code to the payment cloud platform, the offline payment code can be analyzed and verified by the payment cloud platform directly in combination with the current time point. If the offline payment code passes the verification, for example, the device code, the device information and the user information of the payment terminal can be included to pass the verification, the offline payment success message is sent to the code scanning terminal, so that the code scanning payee can obtain the current payment result.
The payment terminal can send the user information, the equipment code and the equipment information to the payment cloud platform for registration and verification. When the user information, the equipment code and the equipment information of the payment terminal are verified through the payment cloud platform, the equipment code and the equipment information corresponding to the user information can be updated to the payment cloud platform, the user information is invalid corresponding to other equipment codes and equipment information, the payment cloud platform sends an effective private key and encrypted payment data to the verified payment terminal, the payment terminal decrypts according to the encrypted payment data, and an offline payment code for payment is generated by combining the current time point, so that the security of offline payment is improved.
Fig. 2 is a schematic view of an implementation process of an offline payment method according to an embodiment of the present application, which is detailed as follows:
in step S201, the encrypted payment data and the private key stored locally are read;
specifically, when the payment terminal reads the encrypted payment data stored locally, the operation of reading the encrypted payment data may be triggered when the network of the payment terminal is unavailable.
The encrypted payment data corresponds to the equipment code of the payment terminal, and after the equipment is added to the payment data, the payment data containing the equipment code is encrypted through a public key to obtain the encrypted payment data.
In this application, the encrypted payment data stored locally is obtained by performing authentication interaction with a payment cloud platform when the network of the payment terminal is effectively connected, and specifically, as shown in fig. 3, the method includes:
in step S301, the payment terminal sends a payment code acquisition request to the payment cloud platform, where the payment code acquisition request may include a device code and/or device information;
the Device code may be a Device identification code, including, For example, a Device ID (Device ID), an IMEI (International Mobile Equipment Identity), an IDFA (Identifier For Advertising Identifier), a UDID (Unique Device Identifier), a UUID (universal Unique Identifier), and the like.
The device information may include information on a brand of a payment terminal, a model of the payment terminal, and the like.
In addition, when the payment terminal does not contain the device code, the payment terminal may send a request for obtaining the device code to the payment cloud platform, and return the device code generated by the payment cloud platform. And updating other device codes corresponding to the account of the payment terminal in the payment cloud platform to be invalid according to the generated device codes, so that the encrypted payment data of the same user is established in the payment cloud platform and corresponds to the same device code. When the payment cloud platform returns the device code, the device code also can comprise a private key and data such as the effective date and the effective date of the private key, so that the original payment data in the encrypted payment data can be conveniently obtained through the private key.
In step S302, the payment cloud platform authenticates the payment terminal;
when the payment terminal sends the payment code acquisition request, the payment cloud platform can authenticate the payment terminal according to account information of the payment terminal, for example, when the payment terminal acquires the payment code through a wechat applet interface, the payment terminal can be authenticated through a wechat account.
In step S303, after passing the authentication of the payment cloud platform, encrypted payment data is returned to the payment terminal.
And if the payment cloud platform detects that the service life of the key in the payment terminal reaches a preset updating requirement, the key can be updated, and the encrypted payment data is returned to the payment terminal. And also includes the private key in the key, and the time stamp of the private key.
After the payment terminal passes the authentication, the device code and/or the device information set by the user account can be compared, and if the device code and the device information in the current request are different from the device code and/or the device information set previously, the device code and/or the device information set previously can be set invalid. Therefore, the safety of the payment terminal for completing off-line payment can be ensured.
In order to ensure the security of offline payment, the encrypted payment data and the private key in the secret key may be sent at different time points, for example, the encrypted payment data may be sent at a first time point, the private key may be sent at a second time point, and the time interval between the first time point and the second time point is greater than a predetermined time length. And the encrypted payment data can be stored in an encrypted manner by an application program of the payment terminal, for example, the data security is ensured by a data storage method in the WeChat application program. Data transmission between the payment terminal and the payment cloud platform can adopt a safe https safety protocol, and the safety of the payment code is improved.
In addition, when the payment terminal is effectively connected with the payment cloud platform, the quantity of encrypted payment data in the payment terminal can be detected, and when the quantity of the encrypted payment data is less than the preset quantity, the encrypted payment data with the corresponding quantity is sent to the payment terminal.
In step S202, the encrypted payment data is decrypted by the private key to obtain payment original data;
and storing a private key, encrypted payment data and an equipment code in the payment terminal in an off-line manner. The private key and the public key used for obtaining the encrypted payment data by the payment cloud platform are corresponding key pairs. And the encrypted payment data can be decrypted through the secret key to obtain the payment original data corresponding to the encrypted payment data.
When the private key is updated, the encrypted payment data and the timestamp of the valid period starting time of the private key need to be updated correspondingly, and the device code corresponding to the encrypted payment data is updated in the payment cloud platform, so that the payment information comprising the device code can be verified.
In step S203, calculating by using the current time point and a preset check time point to obtain check data corresponding to the offline payment code;
In order to ensure the time-dependent security of the offline payment code, the present application may calculate the effective duration between the preset time and the preset time point, that is, a preset verification time point, by combining with the current time point, and obtain verification data according to a time-dependent formula parameter determined by the effective duration, which may specifically be as shown in fig. 4, including:
in step S401, determining a corresponding number of times N of calculation according to the effective duration, where N is a positive integer;
specifically, when the effective duration is divided, different unit duration division modes can be selected according to the level of the security level, and the number of the unit durations included in the effective duration is calculated according to the selected unit duration, where the number of the unit durations is the obtained calculation number N, and N is a natural number greater than or equal to 1.
For example, the time length from the current time point to the verification time point is 24 hours, and the scales are divided according to hours, so the calculation time N is 24 times, of course, the scales can also be divided according to minutes, the calculation updating time is finer, and the safety is higher.
In step S402, performing loop calculation N times according to a preset loop calculation formula to obtain a final calculation result;
The time correlation formula may be a cyclic calculation formula, the cyclic calculation formula may include multiple types, and different verification data may be generated by controlling the cyclic calculation number N. For example, the loop calculation formula may be: vn+1=μ×V n×(1-Vn) N is a positive integer and N is a maximum of N, given μ and V1Value of (1), 0<V1<1,0<μ<4 and μ is not an integer, and may be, for example, 3.9.
In the first calculation, a calculation result V2 of the first calculation is obtained based on the preset parameters μ and V1, and in the second calculation, a calculation result V3 of the second calculation is obtained by combining the preset parameter μ with the calculation result V2 of the first calculation. The above steps are repeated until the Nth calculation is completed, and a calculation result Vn +1 is obtained.
In step S403, one or more predetermined bits of the final calculation result are intercepted as the check data.
After N times of calculation, the first N bits of the value may be taken as the check data, for example, the first 5 bits may be taken as the check data.
In step S204, an offline payment code for payment is generated by applying the verification data and the payment raw data.
After the verification data and the original payment data are obtained, an offline payment code for payment may be generated according to a preset splicing rule, for example, by splicing the pre-positioning of the verification data after the original payment data or before the original payment data.
The payment terminal can display the generated offline payment code through a screen according to the generated offline payment code, the image comprising the offline payment code is collected by the collection terminal, the original data and the verification data of the payment code are obtained through analysis, and after the current collection is verified, collection operation is carried out on a payment account in the payment terminal according to the original data of the payment code. According to the method and the device, the verification data in the offline payment code can be changed continuously according to the change of the time length from the current time point to the preset time point, so that the offline payment code needs to be generated and updated in combination with the current time point when used, and the security of the payment code is guaranteed. And after the off-line payment code is used once, the original payment code corresponding to the off-line payment code is invalid, and other off-line payments can be completed by using other original payment codes stored in the payment terminal. And the private key of the key pair claimed by the application also comprises valid duration, and when the valid duration of the private key arrives, the payment terminal cannot decrypt the encrypted payment data, so that the security of off-line payment is further ensured.
As shown in fig. 5, an implementation flow of a method for collecting money from an offline payment terminal provided in an embodiment of the present application includes:
In step S501, the offline payment code displayed by the payment terminal is analyzed to obtain the original payment data and the verification data;
after the collection terminal acquires the offline payment code through code scanning, the collection terminal can respectively extract the original payment data and the verification data included in the offline payment code according to a preset combination rule. For example, the offline payment code is composed of the original payment data and the 5-bit check data added at the end, so that the check data can be extracted according to the last 5-bit value, and the other part is the original payment data.
In step S502, according to the analyzed payment original data, a verification time point corresponding to the payment original data is searched;
the check time point may be a node at a predetermined time after the check data is generated, for example, 24 hours after the check data is generated. Different check time points can also be set for different payment codes.
In step S503, calculating to obtain verification data according to the verification time point and in combination with a preset verification parameter;
according to the checking time point and the current time for acquiring the offline payment code, checking data during checking the offline payment code can be determined, namely, the time duration between the current time for acquiring the offline payment code and the checking time point can be determined through the checking time point and the current time for acquiring the offline payment code, the time duration is divided to obtain the cyclic calculation times N of the cyclic calculation formula, and the checking data is obtained through calculation according to the cyclic calculation times N.
In step S504, if the verification data obtained by analyzing the calculated verification data is consistent, a payment deduction is performed according to the payment original data.
If the verification data are in accordance with each other, the time length from the time point generated by the offline payment code to the preset verification time point and the time length between the time point of the image acquired by the code scanning terminal and the verification time point are represented, the same calculation times N are corresponded, the time N belongs to the preset effective safety time range, and the offline payment code can be subjected to time verification.
The equipment code and the payment original data and/or the equipment information can be subjected to HASH coding, so that a collection terminal can directly verify the authority of the payment terminal.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Fig. 6 is a schematic structural diagram of an offline payment apparatus according to an embodiment of the present application, which is detailed as follows:
the offline payment apparatus includes:
an encrypted payment data reading unit 601 configured to read encrypted payment data and a private key stored locally;
A payment original data obtaining unit 602, configured to decrypt the encrypted payment data through the private key to obtain payment original data;
the verification data calculation unit 603 is configured to calculate, using the current time point and a preset verification time point, to obtain verification data corresponding to the offline payment code;
an offline payment code generating unit 604, configured to apply the verification data and the payment raw data to generate an offline payment code for payment.
The offline payment apparatus corresponds to the offline payment method shown in fig. 2.
Fig. 7 is a schematic diagram of a payment terminal provided in an embodiment of the present application. As shown in fig. 7, the payment terminal 7 of this embodiment includes: a processor 70, a memory 71 and a computer program 72, such as an offline payment program, stored in said memory 71 and executable on said processor 70. The processor 70, when executing the computer program 72, implements the steps in the various offline payment method embodiments described above. Alternatively, the processor 70 implements the functions of the modules/units in the above-described device embodiments when executing the computer program 72.
Illustratively, the computer program 72 may be partitioned into one or more modules/units that are stored in the memory 71 and executed by the processor 70 to accomplish the present application. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program 72 in the payment terminal 7. For example, the computer program 72 may be divided into:
The encrypted payment data reading unit is used for reading the encrypted payment data and the private key which are stored locally;
the payment original data acquisition unit is used for decrypting the encrypted payment data through the private key to obtain payment original data;
the verification data calculation unit is used for calculating to obtain verification data corresponding to the offline payment code at the current time point;
and the off-line payment code generating unit is used for generating an off-line payment code for payment according to the verification data and the payment original data.
The payment terminal 7 may be a desktop computer, a notebook, a palm computer, or other computing devices. The payment terminal may include, but is not limited to, a processor 70, a memory 71. It will be appreciated by those skilled in the art that fig. 7 is merely an example of the payment terminal 7 and does not constitute a limitation of the payment terminal 7 and may include more or less components than those shown, or some components in combination, or different components, for example the payment terminal may also include input output devices, network access devices, buses, etc.
The Processor 70 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 71 may be an internal storage unit of the payment terminal 7, such as a hard disk or a memory of the payment terminal 7. The memory 71 may also be an external storage device of the payment terminal 7, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, provided on the payment terminal 7. Further, the memory 71 may also include both an internal storage unit and an external storage device of the payment terminal 7. The memory 71 is used for storing the computer program and other programs and data required by the payment terminal. The memory 71 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the description of each embodiment has its own emphasis, and reference may be made to the related description of other embodiments for parts that are not described or recited in any embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/terminal device and method may be implemented in other ways. For example, the above-described embodiments of the apparatus/terminal device are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit may be implemented in the form of hardware, or may also be implemented in the form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow in the method of the embodiments described above can be realized by a computer program, which can be stored in a computer-readable storage medium and can realize the steps of the embodiments of the methods described above when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain other components which may be suitably increased or decreased as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media which may not include electrical carrier signals and telecommunications signals in accordance with legislation and patent practice.
The above-mentioned embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (7)

1. An offline payment method, comprising:
reading the encrypted payment data and the private key stored locally;
decrypting the encrypted payment data through the private key to obtain payment original data;
calculating by using the current time point and a preset check time point to obtain check data corresponding to the offline payment code;
generating an offline payment code for payment by applying the verification data and the payment original data, and generating and updating the offline payment code in combination with the current time point when the offline payment code is used;
the step of obtaining the verification data corresponding to the offline payment code by applying the current time point and the verification time point comprises the following steps:
Calculating the effective duration between the current time point and the check time point;
calculating the effective duration as a parameter of a time correlation formula to obtain the verification data;
the step of calculating the check bit by using the effective duration as a time correlation formula parameter includes:
determining corresponding calculation times according to the effective durationNNIs a positive integer;
circularly calculating according to a preset circular calculation formulaNObtaining a final calculation result;
intercepting one or more predetermined bits of the final calculation result as the check data;
determining corresponding calculation times according to the effective durationNComprises the following steps:
acquiring preset unit time length;
and determining the calculation times N according to the ratio of the effective duration to the unit duration.
2. An off-line payment method as recited in claim 1, wherein the recurring calculation formula isV n+1= μ× V n ×(1-Vn )nTake a positive integer, andntake the maximum value ofNGiven isμAndV1 the value of (a) is,0<V1<1,0<μ<4and is andμnot an integer.
3. The offline payment method of claim 1 wherein said step of applying said verification data and said payment raw data to generate an offline payment code for payment comprises:
Splicing the verification data at a preset position of the payment original data according to a preset splicing rule to obtain offline payment data;
and coding the offline payment data through a preset coding rule to obtain an offline payment code.
4. An offline payment apparatus, comprising:
the encrypted payment data reading unit is used for reading the encrypted payment data and the private key which are stored locally;
the payment original data acquisition unit is used for decrypting the encrypted payment data through the private key to obtain payment original data;
the verification data calculation unit is used for calculating to obtain verification data corresponding to the offline payment code by applying the current time point and a preset verification time point;
an offline payment code generating unit, configured to generate an offline payment code for payment by applying the verification data and the payment raw data, wherein the offline payment code is generated and updated in combination with a current time point when the offline payment code is used;
the step of obtaining the verification data corresponding to the offline payment code by applying the current time point and the verification time point comprises the following steps:
calculating the effective duration between the current time point and the check time point;
Calculating the effective duration as a parameter of a time correlation formula to obtain the verification data;
the step of calculating the check bit by using the effective duration as a time correlation formula parameter includes:
determining corresponding calculation times according to the effective durationNNIs a positive integer;
circularly calculating according to a preset circular calculation formulaNObtaining a final calculation result;
intercepting one or more predetermined bits of the final calculation result as the check data;
determining corresponding calculation times according to the effective durationNComprises the following steps:
acquiring preset unit time length;
and determining the calculation times N according to the ratio of the effective duration to the unit duration.
5. Payment terminal comprising a memory, a processor and a computer program stored in said memory and executable on said processor, characterized in that said processor, when executing said computer program, carries out the steps of the offline payment method according to any one of claims 1 to 3.
6. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the offline payment method according to any one of claims 1 to 3.
7. An offline transaction system for implementing the offline payment method of any one of claims 1 to 3, comprising: at least one payment terminal, at least one collection terminal and payment cloud platform, characterized in that:
the payment terminal receives the encrypted payment data and the private key sent by the cloud platform, when the payment terminal is in an off-line state, the encrypted payment data is decrypted through the private key to obtain original payment data, verification data corresponding to an off-line payment code is obtained through calculation according to the original payment data and the current time point, and the off-line payment code for payment is generated according to the original payment data and the verification data;
the collection terminal reads an offline payment code of the payment terminal, sends the offline payment code to the payment cloud platform and responds to a verification message of offline payment sent by the payment cloud platform;
the payment cloud platform generates an asymmetric key pair, encrypts an original payment code through a public key to obtain encrypted payment data, verifies whether the offline payment code sent by the code scanning terminal is valid or not by combining the current time point, and sends a verification message of offline payment to the code scanning terminal.
CN201910730712.1A 2019-08-08 2019-08-08 Offline payment method, device and equipment Active CN110659899B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910730712.1A CN110659899B (en) 2019-08-08 2019-08-08 Offline payment method, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910730712.1A CN110659899B (en) 2019-08-08 2019-08-08 Offline payment method, device and equipment

Publications (2)

Publication Number Publication Date
CN110659899A CN110659899A (en) 2020-01-07
CN110659899B true CN110659899B (en) 2022-05-27

Family

ID=69036451

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910730712.1A Active CN110659899B (en) 2019-08-08 2019-08-08 Offline payment method, device and equipment

Country Status (1)

Country Link
CN (1) CN110659899B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111340969B (en) * 2020-03-03 2021-01-05 广州优路加信息科技有限公司 Non-card ETC offline processing method and device, computer equipment and storage medium
CN112365256A (en) * 2020-11-06 2021-02-12 中国银联股份有限公司 Payment code management method, terminal device, server, system and storage medium
EP4325418A1 (en) * 2021-04-16 2024-02-21 Digital Currency Institute, The People's Bank of China Method, terminal and system for splitting, verifying and managing digital currency in transaction

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102842081A (en) * 2011-06-23 2012-12-26 上海易悠通信息科技有限公司 Method for generating two-dimensional code and implementing mobile payment by mobile phone
CN105337946A (en) * 2014-08-13 2016-02-17 阿里巴巴集团控股有限公司 Webpage forgery prevention verification method and device
CN106096951A (en) * 2016-06-16 2016-11-09 广州地理研究所 Off-line barcode scanning method of payment
CN106527673A (en) * 2015-09-11 2017-03-22 阿里巴巴集团控股有限公司 Method and apparatus for binding wearable device, and electronic payment method and apparatus
CN108681896A (en) * 2018-03-29 2018-10-19 阿里巴巴集团控股有限公司 Displaying, recognition methods and the device of Quick Response Code
CN109767208A (en) * 2019-01-08 2019-05-17 北京京东金融科技控股有限公司 A kind of method of payment and payment mechanism

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102842081A (en) * 2011-06-23 2012-12-26 上海易悠通信息科技有限公司 Method for generating two-dimensional code and implementing mobile payment by mobile phone
CN105337946A (en) * 2014-08-13 2016-02-17 阿里巴巴集团控股有限公司 Webpage forgery prevention verification method and device
CN106527673A (en) * 2015-09-11 2017-03-22 阿里巴巴集团控股有限公司 Method and apparatus for binding wearable device, and electronic payment method and apparatus
CN106096951A (en) * 2016-06-16 2016-11-09 广州地理研究所 Off-line barcode scanning method of payment
CN108681896A (en) * 2018-03-29 2018-10-19 阿里巴巴集团控股有限公司 Displaying, recognition methods and the device of Quick Response Code
CN109767208A (en) * 2019-01-08 2019-05-17 北京京东金融科技控股有限公司 A kind of method of payment and payment mechanism

Also Published As

Publication number Publication date
CN110659899A (en) 2020-01-07

Similar Documents

Publication Publication Date Title
EP3343831B1 (en) Identity authentication method and apparatus
CN107453862B (en) Scheme for generating, storing and using private key
CN107077670B (en) Method and apparatus for transmitting and processing transaction message, computer readable storage medium
CN107358441B (en) Payment verification method and system, mobile device and security authentication device
CN110659899B (en) Offline payment method, device and equipment
CN104038924B (en) Realize the method and system of Resource Exchange information processing
CN109409472B (en) Two-dimensional code generation method, data processing device and server
CN106527673A (en) Method and apparatus for binding wearable device, and electronic payment method and apparatus
CN111107066A (en) Sensitive data transmission method and system, electronic equipment and storage medium
EP3674936A1 (en) Authentication terminal, authentication device and authentication method and system using authentication terminal and authentication device
CN103944729A (en) Data security interactive method
CN108848057A (en) A kind of method and device of remote secure access
CN113065857A (en) Data processing method, device, equipment, medium and product in payment process
CN104301288A (en) Method and system for online identity authentication, online transaction certification, and online certification protection
CN111052671A (en) System for secure authentication of user identity in an electronic system for banking transactions
KR101407737B1 (en) Apparatus and Method for Processing Finance Banking Information of Smart Device Using QR Code
CN109472612B (en) Safety payment method and device, wearable device and storage medium
CN112053159A (en) Transaction data verification method and device, risk control server and business server
CN107172718B (en) Information processing method and electronic equipment
CN115422584A (en) Data deformation method and device
CN104424453A (en) System and method for verifying non-contact inductive label
KR101710950B1 (en) Method for distributing encrypt key, card reader and system for distributing encrypt key thereof
CN114463012A (en) Authentication method, payment method, device and equipment
CN113094688A (en) Outsourcing marketing terminal business processing system and method
CN105405010B (en) Transaction device, transaction system using the same and transaction method

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