Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for real-time settlement, which can solve the problem of a long settlement period.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a real-time settlement method including:
determining the type of the transaction as a forward transaction or a reverse transaction;
if the transaction is a forward transaction, judging whether the transaction state of the transaction is normal or not, if so, performing real-time settlement according to the transaction, and if not, writing abnormal data of the transaction into an abnormal table;
and if the transaction is reverse transaction, writing the reverse data of the transaction into a reverse table.
Optionally, real-time settlement according to the transaction comprises:
acquiring a payment result corresponding to the transaction through an inquiry interface, and judging whether the payment result is consistent with a payment result displayed on an online page or not;
if yes, carrying out real-time settlement according to the payment result of the transaction; if not, writing the abnormal data of the transaction into an abnormal table.
Optionally, the real-time settlement according to the payment result of the transaction includes:
judging whether a refund transaction is to be withheld in the refund list;
if yes, deduction is carried out according to the refund transaction and the payment result of the transaction, and then real-time settlement is carried out;
if not, carrying out real-time settlement according to the payment result of the transaction.
Optionally, the method further comprises:
and asynchronously processing the abnormal data in the abnormal table and the reverse data in the reverse table.
Optionally, asynchronously processing exception data in the exception table, including:
acquiring the account checking file through the query interface, comparing the abnormal data in the abnormal table with the data in the account checking file, and performing refund or bill replenishment according to the comparison result;
and/or the presence of a gas in the gas,
asynchronously processing reverse data in the reverse table, comprising:
and acquiring the account checking file through the query interface, comparing the reverse data in the reverse table with the data in the account checking file, and writing the reverse data into a refund list according to a comparison result.
In addition, according to another aspect of the embodiments of the present invention, there is provided an apparatus for real-time settlement, including:
the judging module is used for determining the type of the transaction as a forward transaction or a reverse transaction;
the settlement module is used for judging whether the transaction state of the transaction is normal or not if the transaction is a forward transaction, carrying out real-time settlement according to the transaction if the transaction state of the transaction is normal, and writing abnormal data of the transaction into an abnormal table if the transaction state of the transaction is not normal; and if the transaction is reverse transaction, writing the reverse data of the transaction into a reverse table.
Optionally, real-time settlement according to the transaction comprises:
acquiring a payment result corresponding to the transaction through an inquiry interface, and judging whether the payment result is consistent with a payment result displayed on an online page or not;
if yes, carrying out real-time settlement according to the payment result of the transaction; if not, writing the abnormal data of the transaction into an abnormal table.
Optionally, the real-time settlement according to the payment result of the transaction includes:
judging whether a refund transaction is to be withheld in the refund list;
if yes, deduction is carried out according to the refund transaction and the payment result of the transaction, and then real-time settlement is carried out;
if not, carrying out real-time settlement according to the payment result of the transaction.
Optionally, the method further comprises:
and the asynchronous processing module is used for asynchronously processing the abnormal data in the abnormal table and the reverse data in the reverse table.
Optionally, asynchronously processing exception data in the exception table, including:
acquiring the account checking file through the query interface, comparing the abnormal data in the abnormal table with the data in the account checking file, and performing refund or bill replenishment according to the comparison result;
and/or the presence of a gas in the gas,
asynchronously processing reverse data in the reverse table, comprising:
and acquiring the account checking file through the query interface, comparing the reverse data in the reverse table with the data in the account checking file, and writing the reverse data into a refund list according to a comparison result.
According to another aspect of the embodiments of the present invention, there is also provided an electronic device, including:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any of the embodiments described above.
According to another aspect of the embodiments of the present invention, there is also provided a computer readable medium, on which a computer program is stored, which when executed by a processor implements the method of any of the above embodiments.
One embodiment of the above invention has the following advantages or benefits: because the technical means of carrying out real-time settlement on the forward transaction and carrying out asynchronous processing on the abnormal transaction and the reverse transaction is adopted, the technical problem of long settlement period is solved; the invention settles forward transactions in real time and asynchronously processes abnormal transactions and reverse transactions, thereby achieving the purpose of settling the current-day funds of the merchants in real time and meeting the time length requirement of the funds settlement of all the merchants. The embodiment of the invention solves the problems that the settlement time of the payment company and the institution at present cannot meet the requirements of all merchants, and the capital operation of the merchants is difficult and the like; the technical effect that most of funds of the merchants can be settled to the accounts of the merchants in real time every day is achieved, the operation difficulty caused by the problems of fund interruption and the like is avoided, and the viscosity of the merchants is greatly improved; the method can also be used for dealing with scenes with large Internet request quantity, and can keep better processing performance and calculation efficiency.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Aiming at the prior art scheme, the settlement for T +1 day or the later settlement for a longer period cannot meet the requirements of all people, particularly, many small merchants have less funds and are not easy to turnover, so that the merchants cannot be directly operated normally, which is particularly prominent in a large promotion period, because the transaction amount of a certain day is the vast majority of the funds of the merchants, and if the merchants cannot be timely returned, the paralysis of the later operation can be directly caused. And the long settlement period may not be beneficial to the increase of the merchant residence rate, and finally the merchant runs away.
The real-time settlement method provided by the embodiment of the invention can solve the problems of merchant fund breakage and merchant loss caused by a long settlement period, achieves the technical effect that most of the funds of the merchant can be settled to the account of the merchant in real time every day, avoids operation difficulty caused by the problems of fund interruption and the like, and greatly improves the viscosity of the merchant.
Fig. 1 is a schematic diagram of a main flow of a method of real-time settlement according to an embodiment of the present invention. As shown in fig. 1, as an embodiment of the present invention, the real-time settlement method may include:
step 101, determining the type of the transaction as a forward transaction or a reverse transaction.
As shown in fig. 2, the forward transactions (i.e., data indicating the success of normal transactions) account for more than 95% of the daily transaction amount, and such transactions normally go through steps (1) to (4) in fig. 2, and return a prompt indicating the success of payment to the user. Reverse transactions are often referred to as refunds, which are initiated against an originally successful forward transaction, for example, a user initiates a refund on a page, which is a reverse transaction.
Therefore, after the transaction is finished, the type of the transaction can be judged to be a forward transaction or a reverse transaction through the step 101, so that different operations can be executed for different types of transactions in subsequent steps, and the forward transaction can be guaranteed to be settled in real time.
Step 102, if the transaction is a forward transaction, judging whether the transaction state of the transaction is normal, if so, performing real-time settlement according to the transaction, and if not, writing abnormal data of the transaction into an abnormal table; and if the transaction is reverse transaction, writing the reverse data of the transaction into a reverse table.
In this step, by determining whether the transaction is a forward transaction or a reverse transaction, different operations are respectively performed: if the transaction is a forward transaction, judging whether the transaction state of the transaction is normal or not, if so, carrying out real-time settlement according to the transaction, and if not, writing abnormal data of the transaction into an abnormal table; and if the transaction is a reverse transaction, writing the reverse data of the transaction into a reverse table.
For forward transaction, whether the transaction state of the transaction is normal needs to be judged firstly, and if the transaction state is normal, real-time settlement is directly carried out on a corresponding merchant; and if the transaction state is abnormal, directly writing abnormal data of the transaction into an abnormal table to be asynchronously processed. The abnormal data comprises information such as transaction time, transaction amount, order number, user identification, transaction state and transaction type. In step (3) and step (4) in fig. 2, abnormal conditions, such as timeout, network interruption, etc., occur, and the user is prompted by such transactions that the transactions are not completed, but money may have been deducted, so the processing mode is to write the abnormal data into the abnormal table first, and then perform error processing uniformly.
For reverse transactions, such transactions are initiated for original successful forward transactions, if original transaction data are settled to a merchant in real time, loss of a payment institution or a bank may be caused at this time, and the reverse data of the transactions are written into a reverse table for asynchronous processing because the result of the data can not be returned in real time. The reverse data comprises information such as transaction time, transaction amount, order number, user identification, transaction state and transaction type.
In one embodiment of the invention, real-time settlement based on the transaction comprises: acquiring a payment result corresponding to the transaction through an inquiry interface, and judging whether the payment result is consistent with a payment result displayed on an online page or not; if yes, carrying out real-time settlement according to the payment result of the transaction; if not, writing the abnormal data of the transaction into an abnormal table.
In this embodiment, if it is determined that the transaction state of the transaction is normal, a payment result corresponding to the transaction is obtained through an inquiry interface provided by a bank, and whether the payment result is consistent with the payment result displayed on the online page is determined (i.e., step (5) in fig. 2), and if the payment result inquired through the inquiry interface is consistent with the payment result displayed on the online page, the payment result is directly sent to the corresponding merchant for real-time settlement according to the transaction result. And if the payment result inquired through the inquiry interface is inconsistent with the payment result displayed on the online page, indicating that the transaction is abnormal, writing abnormal data of the transaction into an abnormal table to be asynchronously processed. The abnormal data comprises information such as transaction time, transaction amount, order number, user identification, transaction state and transaction type.
In yet another embodiment of the present invention, the real-time settlement according to the payment result of the transaction comprises: judging whether a refund transaction is to be withheld in the refund list; if yes, deduction is carried out according to the refund transaction and the payment result of the transaction, and then real-time settlement is carried out; if not, carrying out real-time settlement according to the payment result of the transaction.
In this embodiment, since the reverse transaction generates a refund list, before the transaction is settled in real time, it is first determined whether there is a refund transaction to be withheld in the refund list, if there is a refund transaction to be withheld in the refund list, the refund transaction and the payment result of the transaction are withheld first, and if there is a remainder after the withholding, the transaction is directly settled in real time according to the remaining amount; and if the refund transaction is not withheld in the refund list, directly carrying out real-time settlement on the corresponding merchant according to the payment result of the transaction.
In still another embodiment of the present invention, after step 102, the method may further include: and asynchronously processing the abnormal data in the abnormal table and the reverse data in the reverse table. Therefore, the embodiment of the invention settles each forward transaction in real time through the query interface and asynchronously processes the abnormal data and the reverse data, thereby achieving the purpose of settling the current-day funds of the merchants in quasi-real time and meeting the time length requirement of the funds settlement of all the merchants.
Optionally, asynchronously processing exception data in the exception table, including: and acquiring the account checking file through the query interface, comparing the abnormal data in the abnormal table with the data in the account checking file, and performing refund or bill replenishment according to a comparison result.
Optionally, asynchronously processing the reverse data in the reverse table includes: and acquiring the account checking file through the query interface, comparing the reverse data in the reverse table with the data in the account checking file, and writing the reverse data into a refund list according to a comparison result.
For reverse transactions, the transactions are initiated for original successful forward transactions, if original transaction data are settled to a merchant in real time, loss of a payment mechanism or a bank may be caused at this time, and the results of the data can not be returned in real time, so that after the T +1 day is uniformly compared with an account checking file, if the transaction exists in the account checking file, the refund data results are written into a refund list, and the settlement amount of the subsequent forward transactions is deducted.
According to the various embodiments, the technical scheme of settling forward transactions in real time and asynchronously processing abnormal transactions and reverse transactions is adopted, so that the problem of long settling period is solved. That is, in the prior art, the problem that the fund is in place for a long time and the settlement requirements of all merchants cannot be met still exists. The invention settles forward transactions in real time and asynchronously processes abnormal transactions and reverse transactions, thereby achieving the purpose of settling the current-day funds of the merchants in real time and meeting the time length requirement of the funds settlement of all the merchants. The embodiment of the invention solves the problems that the settlement time of the payment company and the institution at present cannot meet the requirements of all merchants, and the capital operation of the merchants is difficult and the like; the technical effect that most of funds of the merchants can be settled to the accounts of the merchants in real time every day is achieved, the operation difficulty caused by the problems of fund interruption and the like is avoided, and the viscosity of the merchants is greatly improved; the method can also be used for dealing with scenes with large Internet request quantity, and can keep better processing performance and calculation efficiency.
Fig. 3 is a schematic diagram of a main flow of a real-time settlement method according to one referential embodiment of the present invention, and the real-time settlement method may include:
step 1, finishing the on-line transaction and starting to settle accounts in real time.
And 2, judging the type of the transaction, continuing the process if the transaction is a forward transaction, and directly writing the reverse data into a database reverse table if the transaction is a reverse transaction.
Step 3, if the transaction is forward, the transaction state is judged, and if the transaction state is normal, an inquiry interface provided by a channel is directly inquired; and if the transaction state is abnormal, directly writing the abnormal data into the database abnormal table.
Step 4, judging whether the payment result obtained through the inquiry interface is consistent with the payment result displayed on the online page, if so, judging whether the refund transaction of the current merchant is to be withheld in the refund list; if not, the abnormal data is directly written into the abnormal table of the database.
Step 5, if the merchant does not have refund transaction to be withheld, directly settling accounts to the merchant in real time; if the refund transaction is to be deducted, the refund transaction is directly deducted, and if the residual amount is left after deduction, the real-time settlement is directly carried out.
In step 2, after the reverse data is written into the reverse table of the database, account checking is carried out according to account checking files provided by subsequent channels, and if the transaction exists in the account checking files, the comparison result is written into a refund list for use in real-time settlement judgment of the main process.
And 3, inserting data of the abnormal table in the step 4, comparing the data according to the channel account checking file of the day T +1, and if the transaction exists in the account checking file, performing subsequent refund or order replenishment on the order user.
In addition, in one embodiment of the present invention, the detailed implementation of the real-time settlement method is described in detail above, and therefore, the repeated content will not be described herein.
Fig. 4 is a schematic diagram of main blocks of an apparatus for real-time settlement according to an embodiment of the present invention. As shown in fig. 4, the real-time settlement apparatus 400 includes a determining module 401 and a settlement module 402. The judging module 401 is configured to determine that the type of the transaction is a forward transaction or a reverse transaction; the settlement module 402 is configured to determine whether a transaction state of the transaction is normal if the transaction is a forward transaction, perform real-time settlement according to the transaction if the transaction state is normal, and write abnormal data of the transaction into an abnormal table if the transaction state is not normal; and if the transaction is reverse transaction, writing the reverse data of the transaction into a reverse table.
Optionally, real-time settlement according to the transaction comprises:
acquiring a payment result corresponding to the transaction through an inquiry interface, and judging whether the payment result is consistent with a payment result displayed on an online page or not;
if yes, carrying out real-time settlement according to the payment result of the transaction; if not, writing the abnormal data of the transaction into an abnormal table.
Optionally, the real-time settlement according to the payment result of the transaction includes:
judging whether a refund transaction is to be withheld in the refund list;
if yes, deduction is carried out according to the refund transaction and the payment result of the transaction, and then real-time settlement is carried out;
if not, carrying out real-time settlement according to the payment result of the transaction.
Optionally, the system further comprises an asynchronous processing module, and the asynchronous processing module is configured to asynchronously process the exception data in the exception table and the reverse data in the reverse table.
Optionally, asynchronously processing exception data in the exception table, including:
acquiring the account checking file through the query interface, comparing the abnormal data in the abnormal table with the data in the account checking file, and performing refund or bill replenishment according to the comparison result;
and/or the presence of a gas in the gas,
asynchronously processing reverse data in the reverse table, comprising:
and acquiring the account checking file through the query interface, comparing the reverse data in the reverse table with the data in the account checking file, and writing the reverse data into a refund list according to a comparison result.
According to the various embodiments, the technical scheme of settling forward transactions in real time and asynchronously processing abnormal transactions and reverse transactions is adopted, so that the problem of long settling period is solved. That is, in the prior art, the problem that the fund is in place for a long time and the settlement requirements of all merchants cannot be met still exists. The invention settles forward transactions in real time and asynchronously processes abnormal transactions and reverse transactions, thereby achieving the purpose of settling the current-day funds of the merchants in real time and meeting the time length requirement of the funds settlement of all the merchants. The embodiment of the invention solves the problems that the settlement time of the payment company and the institution at present cannot meet the requirements of all merchants, and the capital operation of the merchants is difficult and the like; the technical effect that most of funds of the merchants can be settled to the accounts of the merchants in real time every day is achieved, the operation difficulty caused by the problems of fund interruption and the like is avoided, and the viscosity of the merchants is greatly improved; the method can also be used for dealing with scenes with large Internet request quantity, and can keep better processing performance and calculation efficiency.
It should be noted that, in the implementation of the real-time settlement apparatus of the present invention, the details of the real-time settlement method are already described in detail, and therefore, the repeated contents are not described herein.
Fig. 5 illustrates an exemplary system architecture 500 to which the method of real-time settlement or the method of real-time settlement of an embodiment of the present invention may be applied.
As shown in fig. 5, the system architecture 500 may include terminal devices 501, 502, 503, a network 504, and a server 505. The network 504 serves to provide a medium for communication links between the terminal devices 501, 502, 503 and the server 505. Network 504 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 501, 502, 503 to interact with a server 505 over a network 504 to receive or send messages or the like. The terminal devices 501, 502, 503 may have installed thereon various communication client applications, such as shopping-like applications, web browser applications, search-like applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 501, 502, 503 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 505 may be a server providing various services, such as a background management server (for example only) providing support for shopping websites browsed by users using the terminal devices 501, 502, 503. The background management server may analyze and process the received data such as the product information query request, and feed back a processing result (for example, target push information and product information — only an example) to the terminal device.
It should be noted that the method for real-time settlement provided by the embodiment of the present invention is generally executed in the server 505, and accordingly, the real-time settlement apparatus is generally disposed in the server 505. The real-time settlement method provided by the embodiment of the invention can also be executed on the terminal equipment 501, 502 and 503, and accordingly, the real-time settlement device is generally arranged on the terminal equipment 501, 502 and 503.
It should be understood that the number of terminal devices, networks, and servers in fig. 5 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 6, a block diagram of a computer system 600 suitable for use with a terminal device implementing an embodiment of the invention is shown. The terminal device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU)601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 601.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes a determination module, a settlement module, and an asynchronous processing module, wherein the names of the modules do not in some cases constitute a limitation on the module itself.
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: determining the type of the transaction as a forward transaction or a reverse transaction; if the transaction is a forward transaction, judging whether the transaction state of the transaction is normal or not, if so, performing real-time settlement according to the transaction, and if not, writing abnormal data of the transaction into an abnormal table; and if the transaction is reverse transaction, writing the reverse data of the transaction into a reverse table.
According to the technical scheme of the embodiment of the invention, because the technical means of carrying out real-time settlement on the forward transaction and carrying out asynchronous processing on the abnormal transaction and the reverse transaction is adopted, the technical problem of long settlement period is solved; the invention settles forward transactions in real time and asynchronously processes abnormal transactions and reverse transactions, thereby achieving the purpose of settling the current-day funds of the merchants in real time and meeting the time length requirement of the funds settlement of all the merchants. The embodiment of the invention solves the problems that the settlement time of the payment company and the institution at present cannot meet the requirements of all merchants, and the capital operation of the merchants is difficult and the like; the technical effect that most of funds of the merchants can be settled to the accounts of the merchants in real time every day is achieved, the operation difficulty caused by the problems of fund interruption and the like is avoided, and the viscosity of the merchants is greatly improved; the method can also be used for dealing with scenes with large Internet request quantity, and can keep better processing performance and calculation efficiency.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.