Disclosure of Invention
In order to solve the above problems, the present invention provides a method, an apparatus and a system for supporting offline and online payments, which are compatible with online and offline payments at the same time.
The technical scheme of the invention is realized as follows:
the invention discloses a method for supporting off-line and on-line payment, which comprises the following steps:
s1, starting display of an online payment code of a payment terminal;
s2, automatically caching offline generation information required by offline payment online;
and S3, when the offline payment is detected, generating an offline payment code according to the offline generation information.
Further, in step S2, specifically, the method includes:
multiple sets of payment codes needed for offline payments are automatically cached online.
Further, in step S2, specifically, the method includes:
the online auto-calibration device time is used for offline payment.
Further, the step S2 is followed by the following steps:
and S21, judging whether the online payment is offline payment, if the online payment is online payment, returning to the step S1, and if the offline payment is offline payment, entering the step S3.
The invention discloses a device for supporting off-line and on-line payment, comprising:
the starting unit is used for starting the display of the online payment code of the payment terminal;
the cache unit is used for automatically caching offline generation information required by offline payment online;
and the offline payment unit is used for generating an offline payment code according to the offline generation information when the offline payment is detected.
Further, the cache unit is used for automatically caching a plurality of groups of payment codes required for offline payment on line.
Further, the control unit is used for online automatic device time for offline payment.
Further, the cache unit is also followed by the following units:
and the judging unit is used for judging whether online payment or offline payment is carried out, if the online payment is carried out, the starting unit is returned, and if the offline payment is carried out, the offline payment unit is entered.
The invention discloses a system supporting off-line and on-line payment, which comprises a payment terminal and a background server, wherein the background server is connected with the payment terminal, and the payment terminal comprises the device.
Further, the payment terminal comprises a payable electronic card or a smart phone.
The method, the device and the system for supporting offline and online payment have the following beneficial technical effects:
the method, the device and the system for supporting the off-line payment and the on-line payment are in the same payment terminal, can adopt two different payment modes of the off-line payment and the on-line payment, and are more convenient.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1 and 2, an embodiment of the present invention provides a method for supporting offline and online payments, including:
s1, starting display of an online payment code of a payment terminal;
and the online payment and the offline payment are adaptively switched, the offline payment is automatically switched to the offline generated payment code when the offline payment is detected, and the online payment code is automatically generated when the online payment is detected.
S2, automatically caching offline generation information required by offline payment online;
the step S2 specifically includes:
multiple sets of payment codes needed for offline payments are automatically cached online.
The online auto-calibration device time is used for offline payment.
The following steps are also provided after step S2:
and S21, judging whether the online payment is offline payment, if the online payment is online payment, returning to the step S1, and if the offline payment is offline payment, entering the step S3.
The invention discloses a method for realizing compatibility of online payment and offline payment, which comprises the following steps:
preferentially using an online payment code generation mode during online;
generating a payment code on line and acquiring a plurality of groups of payment code related information from a network side so as to generate the payment code off line;
the equipment time can be synchronously calibrated in the online process, so that the requirement on the precision of the equipment can be properly lowered;
preferentially extracting the payment code from the cache region to generate the payment code during offline;
when the payment system is off-line, the payment code can be generated according to the calibrated time;
the technology is not only applied to the payment field, but also applied to other application scenarios needing uniqueness determination, such as member accounts and the like.
And S3, when the offline payment is detected, generating an offline payment code according to the offline generation information.
In order to fully utilize the advantages of online payment and offline payment, the technical scheme designs a method for combining online payment and offline payment.
And the online time cache acquires multiple groups of payment code related information or calibration time so as to be used offline.
And after the device detects the offline, automatically taking a group of payment code related information from the cache information to generate a consumable payment code, or generating the payment code according to the calibrated time.
Because the equipment can be connected with the internet frequently, the time can be calibrated at any time, so that the requirement on the time precision of the equipment is not high, and the equipment cost is reduced.
Because the related information of a plurality of groups of payment codes is cached, the requirement on hardware is reduced, and the payment codes can be generated in time when the equipment is off-line.
The following further describes an apparatus for implementing the above method, and reference may be made to the above method description for parts not described in the apparatus.
Referring to fig. 3, an apparatus 1 for supporting offline and online payment includes:
a starting unit 10 for starting the display of the online payment code of the payment terminal for online payment;
a cache unit 20, configured to automatically cache offline generation information required for offline payment online;
and the offline payment unit 30 is configured to generate an offline payment code according to the offline generation information when offline payment is detected.
The caching unit 20 is used for automatically caching a plurality of sets of payment codes required for offline payment online.
The buffer unit 20 may also be used for online automatic calibration of device time for offline payments.
The cache unit 20 is also followed by the following units:
and the judging unit 25 is used for judging whether online payment or offline payment is carried out, if the online payment is carried out, the online payment returns to the starting unit 10, and if the offline payment is carried out, the offline payment enters the offline payment unit 30.
In the device, when monitoring that the equipment (terminal) is on-line, the system acquires a group of payment information from the server, simultaneously caches a plurality of groups of payment related information, and simultaneously calibrates time, so that the next off-line time can be taken from the cached data or calibrated time and generate payment code information.
Referring to fig. 4, a system 100 for supporting offline and online payment includes a payment terminal 200 and a backend server 300, where the backend server 300 is connected to the payment terminal 200, and the payment terminal 200 includes the apparatus 1.
The payment terminal 200 includes a payable electronic card or a smart phone.
When the system monitors that the equipment is offline, the payment related information is extracted from the cached multiple sets of payment related information or the last calibration time, and then the payment code is generated by using the information.
The backend server 300 may be connected to the payment terminal 200 by wire or wirelessly through 3G, 4G, WIFI, etc.
The system 100 works as follows:
starting the payment terminal 200;
when the device 1 detects that the wireless signal network signal exists, an online payment code is generated, and after the code is scanned by a user, fee deduction is realized from a financial account (such as a bank account) bound by a background server 300 connected with the payment terminal 200.
Meanwhile, multiple sets of payment codes or calibration time required for offline payment are automatically cached online for later use, so that when no wireless signal network signal exists, the multiple sets of payment codes or calibration time can be extracted by the processor of the payment terminal 200 to generate offline payment codes;
when the device 1 detects that no wireless signal network signal exists, the device extracts the on-line standby payment code from the memory of the payment terminal 200 to generate an off-line payment code, and after the user scans the code, the user deducts the fee from the financial account (such as a bank account) bound by the background server 300 connected with the payment terminal 200.
Or extracting the calibrated time in the online process, generating an offline payment code in real time, and after the user scans the code, realizing fee deduction from a financial account (such as a bank account) bound by the background server 300 connected with the payment terminal 200.
The method, the device and the system for supporting offline and online payment have the following beneficial technical effects:
the method, the device and the system for supporting the off-line payment and the on-line payment are in the same payment terminal, can adopt two different payment modes of the off-line payment and the on-line payment, and are more convenient.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention 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 invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. 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 1 flow or flows and/or block 1 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 of FIG. 1 and/or block diagram block or blocks of FIG. 1.
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 1 flow or flows and/or block 1 block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various modifications and variations can be made in the embodiments of the present invention without departing from the spirit or scope of the embodiments of the invention. Thus, if such modifications and variations of the embodiments of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to encompass such modifications and variations.