Real-time payment method and system, terminal equipment and storage medium
By automatically sending inquiries and cancellation requests in the real-time payment system, it solves the problem of unknown payment results caused by network fluctuations, improves transaction efficiency and accuracy, reduces operating costs, and avoids the generation of single-sided accounts.
Patent Information
- Application Number
- CN202410762700.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-13
- Publication Date
- 2024-10-01
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
During the real-time payment process, network fluctuations or weak signals cause the POS terminal to be unable to receive data returned by the payment platform, requiring manual query of transaction results, which is time-consuming and error-prone, and may lead to the generation of single-sided accounts.
Provide a real-time payment method and system that automatically sends query requests when clear payment results are not received, and automatically initiates order cancellation when network problems persist, reducing manual intervention and improving the accuracy and efficiency of transaction results. This method includes obtaining payment data, converting it into payment information, saving it to the cache, sending a payment request, receiving and processing the returned result, sending a query or cancellation request if it is not clear, and processing the payment information in an unknown status in a timely manner to avoid single-sided accounts.
Automated processing reduces manual inquiries and misoperations, improves the accuracy and efficiency of transaction results, reduces operating costs, handles network problems and system abnormalities in a timely manner, and avoids the generation of single-sided accounts.
Smart Images

Figure CN118735510A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of online payment, and in particular to a real-time payment method and system, terminal equipment, and storage medium. Background Art
[0002] With the help of mobile payment technology, real-time payment technology has changed the traditional capital circulation mode, improved the efficiency of capital use and consumer shopping experience. Real-time payment usually uses POS terminals to scan code payment.
[0003] When the POS terminal is performing Alipay\WeChat\UnionPay scan code payment, if there are problems such as network fluctuations or weak signals, after the terminal scans the code, there may be an abnormal situation where the backend of Alipay\WeChat\UnionPay has successfully deducted the fee, but the terminal cannot receive the data returned by Alipay\WeChat\UnionPay. The current solution is generally to manually check whether the transaction is successful on the POS terminal.
[0004] Such an operation method that requires manual query is not only time-consuming, but may also lead to wrong transaction results due to manual errors. Summary of the invention
[0005] In order to improve payment efficiency and increase the accuracy of transaction results, the present application provides a real-time payment method and system, a terminal device, and a storage medium.
[0006] In the first aspect, a real-time payment method provided by the present application adopts the following technical solution: A real-time payment method, comprising the following steps: Obtain payment data; Convert the payment data into payment information and save the payment information to the cache; Send a payment request to the payment platform according to the payment information; Upon receiving a clear payment result from the payment platform, the payment information is deleted, the transaction result is output and the transaction is ended; if no clear payment result is received, a query request is sent to the payment platform; upon receiving a clear payment result from the payment platform, the payment information is deleted, the transaction result is output and the transaction is ended; if no clear payment result is received, a request to cancel payment is sent to the payment platform based on the payment information; upon receiving a clear cancellation result from the payment platform, the payment information is deleted, the transaction result is output and the transaction is ended; if no clear cancellation result is received from the payment platform, the transaction result is output and the transaction is ended.
[0007] By adopting the above technical solution, the payment method is suitable for scenarios when the payment process encounters network fluctuation problems. When no clear payment result is received, a query request is automatically sent, and manual query is no longer required. If no clear payment result is received after the query, it means that the network condition continues to be poor or there is a problem with the system. In order to save transaction time, the order cancellation is automatically initiated according to the payment information, which can effectively avoid the generation of unilateral accounts. In this way, there is no need to manually reconfirm the payment information, and it is better to avoid excessive human involvement in the payment process, reduce the situation of manual misoperation, and improve the accuracy of transaction results. In addition, a request to cancel the payment is sent and the transaction is completed. It is necessary to manually choose whether to re-initiate a new transaction. The links that require manual judgment in the entire process from obtaining payment data to the end of the transaction are reduced, reducing the time cost of manual judgment and operation, thereby achieving more efficient real-time payment, improving transaction efficiency, and reducing operating costs.
[0008] In addition, if the payment platform does not return a clear cancellation result, it means that there is a network problem or a system-level problem, so it is unknown whether the payment is completed. Since the payment information will not be deleted, corresponding processing can be performed based on the payment information left by the payment terminal, further effectively handling the problem of unilateral accounts.
[0009] Optionally, the real-time payment method also includes: after obtaining the payment data and before converting it into payment information, querying in the cache whether the payment information exists; if the payment information exists, sending a request to cancel the payment to the payment platform based on the payment information, and deleting the payment information after receiving a clear cancellation result returned by the payment platform; if no clear cancellation result is received, the transaction ends.
[0010] By adopting the above technical solution, before making a new payment request, a local query is first performed to determine whether there is any unfinished payment action, thereby realizing payment self-inspection and effectively avoiding duplicate payment deductions.
[0011] In addition, whether an unknown error result is received or a successful revocation result is not received can be used to determine whether there is a network fluctuation problem or a system-level problem. This is equivalent to checking before making a new payment transaction, and the check occurs before caching the payment information and sending the payment request. If there is still a network fluctuation problem or a system-level problem, the transaction failure result can be output without going through the payment and query process, which increases transaction efficiency.
[0012] Optionally, the real-time payment method also includes: when there is no payment action, periodically checking whether there is payment information in the cache. If there is payment information, sending a request to cancel the payment to the payment platform based on the payment information. If a clear cancellation result is returned by the payment platform, deleting the payment information.
[0013] By adopting the above technical solution, payment information is cleaned up regularly, the generation of one-sided accounts is reduced, and the cache space occupied by payment information is made as small as possible, thereby increasing the transaction rate of the next transaction. This is suitable for situations where the network fluctuates and helps to process legacy payments during periods of high network signal strength.
[0014] Optionally, the real-time payment method also includes: when there is no payment action, periodically checking whether there is payment information in the cache; if there is payment information, sending a request to cancel the payment to the payment platform based on the payment information; if no clear cancellation result is returned by the payment platform, obtaining a network status index based on a preset algorithm, judging whether there is a network anomaly based on the network status index, and issuing a network anomaly prompt if there is a network anomaly.
[0015] By adopting the above technical solution, if no clear cancellation result is received from the payment platform when there is no payment action, it means that there may be an abnormality in the network environment. Therefore, a network detection is performed. If it is determined that there is an abnormality, it means that the network is likely to be in a continuously weak network state. A prompt is required to help the operator understand the current network environment and make corresponding choices before performing payment operations.
[0016] Optionally, the preset algorithm is as shown in formula (1): Y = W1*N^n + W2*(1 / T^m) + W3*(1-L^p) (1) Where Y is the network status index, N is the signal strength, T is the delay time, L is the packet loss rate, w1, w2, w3 are the weights of signal strength, delay time and packet loss rate respectively, and n, m and p are constants.
[0017] By adopting the above technical solution, the network status is judged by comprehensively considering the signal strength, delay time and packet loss rate, and an index is introduced for calculation, so as to more sensitively capture the slight changes in the network status, thereby better judging whether there is a network abnormality.
[0018] Optionally, the query request sent to the payment platform is a polling request within a predetermined time.
[0019] In the second aspect, a real-time payment method provided by the present application adopts the following technical solution: A real-time payment system, comprising: Payment acquisition module, used to obtain payment data; A data processing module, used for converting payment data into payment information and saving the payment information to a cache; A payment request module, used to send a payment request to the payment platform according to the payment information; The result feedback module is used to receive a clear payment result returned by the payment platform, delete the payment information, and end the transaction; if no clear payment result is received, send a query request to the payment platform; receive a clear payment result returned by the payment platform, delete the payment information, and end the transaction; if no clear payment result is received, send a request to cancel payment to the payment platform based on the payment information; receive a clear cancellation result returned by the payment platform, delete the payment information, and end the transaction; if no clear cancellation result is received from the payment platform, the transaction ends.
[0020] In a third aspect, a terminal device provided by the present application adopts the following technical solution: A terminal device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of a real-time payment method when executing the computer program.
[0021] In a fourth aspect, the present application provides a computer-readable storage medium that adopts the following technical solution: A computer-readable storage medium stores a computer program, which implements the steps of a real-time payment method when executed by a processor.
[0022] In summary, this application has the following beneficial effects: 1. This payment method is suitable for scenarios where the payment process encounters network fluctuation problems. When a clear payment result is not received, a query request is automatically sent, and manual query is no longer required. If a clear payment result is still not received after the query, it means that the network condition continues to be poor or there is a problem with the system. In order to save transaction time, the order cancellation is automatically initiated according to the payment information, which can effectively avoid the generation of unilateral accounts. In this way, there is no need to manually reconfirm the payment information, and it is better to avoid excessive human involvement in the payment process and reduce the situation of manual misoperation. In addition, when sending a request to cancel the payment and the transaction is completed, it is necessary to manually choose whether to re-initiate a new transaction. The links that require manual judgment in the entire process from obtaining payment data to the end of the transaction are reduced, and the time cost of manual judgment and operation is reduced, thereby achieving more efficient real-time payment, improving transaction efficiency, and reducing operating costs. In addition, if a clear cancellation result is not received from the payment platform, it means that there is a network problem or a system-level problem, so whether the payment is completed is unknown. Since the payment information will not be deleted, it can be processed accordingly according to the payment information left by the payment terminal, and the problem of unilateral accounts can be further effectively handled.
[0023] 2. Before making a new payment request, first query locally whether there is payment information to determine whether there is an unfinished payment action, realize payment self-check, and effectively avoid repeated payment deductions. In addition, by whether an unknown error result is received or a successful revocation result is not received, it can be determined whether there is a network fluctuation problem or a system-level problem. This is equivalent to checking before making a new payment transaction, and the check occurs before caching payment information and sending a payment request. If there is still a network fluctuation problem or a system-level problem, there is no need to go through the payment and query process, and the transaction failure result can be output, which is more efficient. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 It is a flow chart of a real-time payment method in one embodiment of the present application.
[0025] Figure 2 It is a flow chart of a real-time payment method including step S11 in one embodiment of the present application.
[0026] Figure 3 This is an example flow chart of a real-time payment method in one embodiment of the present application.
[0027] Figure 4 It is a flow chart of step S50 in the real-time payment method in one embodiment of the present application.
[0028] Figure 5 It is a flow chart of step S51 in the real-time payment method in one embodiment of the present application. DETAILED DESCRIPTION
[0029] The following is combined with Figure 1-5 This application is described in further detail.
[0030] In one embodiment, if Figure 1 As shown, the present application discloses a real-time payment method, which specifically includes the following steps: S10. Obtain payment data.
[0031] In this embodiment, the payment data is the payment data input by the user through the terminal, and the terminal may be a POS machine, a smart phone or a cash register. The method of obtaining the payment data may be a payment method with the participation of the terminal, such as bank card payment, mobile payment, biometric payment, etc. More specifically, for example, the user provides the payment data to the POS machine through a bank card, the POS machine scans the user's barcode to obtain the payment data, and the user provides the payment data to the cash register by scanning the barcode.
[0032] S20. Convert the payment data into payment information and save the payment information to the cache.
[0033] In this embodiment, the terminal converts the acquired payment data into payment information through a preset encoding program, so that each payment will generate specific payment information, and the payment information is saved in the buffer area of the terminal.
[0034] S30. Send a payment request to the payment platform according to the payment information.
[0035] In this embodiment, the payment platform may be a platform that can complete online payment settlement between both parties of the transaction, such as a third-party payment platform such as UnionPay, WeChat or Alipay.
[0036] Specifically, the terminal sends a payment request to the payment platform through the payment interface according to the payment information.
[0037] S40. Upon receiving a clear payment result from the payment platform, the payment information is deleted and the transaction is completed; if no clear payment result is received, a query request is sent to the payment platform; upon receiving a clear payment result from the payment platform, the payment information is deleted and the transaction is completed; if no clear payment result is received, a request to cancel payment is sent to the payment platform based on the payment information; upon receiving a clear cancellation result from the payment platform, the payment information is deleted and the transaction is completed; if no clear cancellation result is received from the payment platform, the transaction is completed.
[0038] Specific and clear payment results include successful payment results and failed payment results. The reasons for failed payment results include but are not limited to insufficient account balance, excessive transaction amount, barcode validity, and merchant lack of authority, etc.
[0039] The situations where a clear payment result is not received include not receiving a clear payment result within the scheduled time and receiving an unknown error result within the scheduled time. The scheduled time can be set according to the actual scenario, such as 0.5s~10s. The reasons for not receiving a clear payment result within the scheduled time include network fluctuations or weak signals, and the terminal cannot receive the data returned by the payment platform; the reasons for the unknown error result are generally system-level problems, including but not limited to system errors, failure to operate the DB, and failure to connect to the DB, etc.
[0040] In the above situation where no clear payment result is received, while the payment fails, there may be a situation where the user's account has changed while the payment platform's account has not changed, that is, there is a risk of one-sided account, so the transaction result cannot be output immediately and the transaction cannot be ended.
[0041] Therefore, the real-time payment method of the present application automatically sends a query request when the payment result is not received, and manual query is no longer required. If the payment result is still not received after the query, it means that the network condition continues to be poor. In order to save transaction time, the order cancellation is automatically initiated according to the payment information, which can effectively avoid the generation of unilateral accounts.
[0042] Specifically, after sending a payment request but not receiving a clear payment result, the terminal sends a query request to the payment platform in a polling manner within a predetermined time. The predetermined time can be set according to the actual scenario, such as 0.5s~10s, that is, the terminal continuously sends query requests to the payment platform within the predetermined time. The polling method can be used in the case of network fluctuations, and the payment result can be obtained during the period of high signal strength during network fluctuations.
[0043] Similarly, clear revocation results include successful revocation and failed revocation results. The reasons for unsuccessful revocation include but are not limited to payment failure and revocation by other means, etc. For successful revocation and failed revocation results, the user's account remains unchanged before and after this delivery, which means that the risk of unilateral account has been eliminated.
[0044] Failure to receive a clear cancellation result returned by the payment platform includes failure to receive a clear cancellation result within the scheduled time and receiving an unknown error result within the scheduled time. The scheduled time can be set according to the actual scenario, such as 0.5s~10s. The cause of the unknown error result is generally a system-level problem, including but not limited to system errors, failure to operate the DB, and failure to connect to the DB.
[0045] If the payment platform does not return a clear cancellation result, it means that there is a network problem or a system-level problem, so it is unknown whether the payment is completed. Since the payment information will not be deleted, corresponding processing can be performed based on the payment information left by the terminal, further effectively handling the problem of unilateral accounts.
[0046] Exemplarily, in a payment scenario, the terminal obtains payment data by scanning the user's QR code, converts the payment data into payment information, and saves the payment information in the terminal's cache area. Based on the payment information, a payment request is sent to the payment platform through the payment interface, and a successful payment result is received from the payment platform. The payment information is deleted, the successful transaction result is output, and the transaction is ended.
[0047] In another payment scenario, after sending a payment request to the payment platform through the payment interface, a payment failure result is received from the payment platform, the payment information is deleted, the transaction failure result is output, and the transaction is ended.
[0048] In another payment scenario, after sending a payment request to the payment platform through the payment interface, no clear payment result is received within the scheduled time and an unknown error result is received within the scheduled time. The terminal sends a query request to the payment platform in a polling manner through the query interface within the scheduled time, receives a successful payment result returned by the payment platform, deletes the payment information, outputs the successful transaction result, and ends the transaction.
[0049] In another payment scenario, after sending a query request to the payment platform in a polling manner within a predetermined time, a payment failure result returned by the payment platform is received, the payment information is deleted, the transaction failure result is output, and the transaction is ended.
[0050] In another payment scenario, after sending a query request to the payment platform in a polling manner within the scheduled time, no clear payment result is received within the scheduled time and an unknown error result is received within the scheduled time. The terminal sends a request to cancel payment to the payment platform through the cancellation interface, receives the successful cancellation result and failed cancellation result returned by the payment platform, deletes the payment information, outputs the transaction failure result, and ends the transaction.
[0051] In another payment scenario, after sending a request to cancel payment to the payment platform through the cancellation interface, if no clear cancellation result is received within the scheduled time and an unknown error result is received within the scheduled time, the payment information is retained, the transaction failure result is output, and the transaction is terminated.
[0052] In one embodiment, if Figure 2 and Figure 3 As shown, the real-time payment method further includes step S11, which is arranged between step S10 and step S20: S11. Check whether there is payment information in the cache. If so, send a request to cancel the payment to the payment platform based on the payment information. After receiving a clear cancellation result returned by the payment platform, delete the payment information and proceed to step S20 to execute the conversion of the payment data into payment information and subsequent operations.
[0053] If no clear revocation result is received, the transaction ends. Specifically, if no revocation success result or revocation failure result is received within the scheduled time, or if an unknown error result is received within the scheduled time, the transaction failure result is output and the transaction ends.
[0054] If it is found that no payment information exists in the cache, the process proceeds to step S20 to execute the conversion of payment data into payment information and subsequent operations.
[0055] Specifically, step S11 is set after obtaining the payment data, which is equivalent to starting step S11 after the terminal obtains the payment data, that is, before making a new payment request, first query whether there is payment information locally to determine whether there is an unfinished payment action, realize payment self-check, and effectively avoid repeated payment deductions. And after executing the self-check, directly continue to execute the conversion of payment data into payment information and subsequent operations to make payment faster.
[0056] In addition, whether a clear revocation result is received can be used to determine whether there is a network fluctuation problem or a system-level problem. This is equivalent to checking before making a new payment transaction, and the check occurs before caching the payment information and sending the payment request. If there is still a network fluctuation problem or a system-level problem, the transaction failure result can be output without going through the payment and query process, reducing the waiting time during the payment process and making the transaction more efficient.
[0057] For example, in a payment scenario, the terminal obtains payment data by scanning the user's QR code, and checks whether the payment information exists in the cache. If the payment information exists, a request to cancel the payment is sent to the payment platform based on the payment information, and the payment information is deleted after receiving a clear cancellation result from the payment platform. The payment data is then converted into payment information, and the payment information is saved in the terminal's cache area. Based on the payment information, a payment request is sent to the payment platform through the payment interface, and a successful payment result is received from the payment platform, and the payment information is deleted, and the successful transaction result is output to end the transaction.
[0058] In one embodiment, if Figure 2 and Figure 4 As shown, the real-time payment method further includes step S50.
[0059] S50. When the terminal is in a state of no payment action, that is, between step S40 and step S10 of the next payment, it is periodically checked whether there is payment information in the cache. If there is payment information, a request to cancel the payment is sent to the payment platform based on the payment information. If a clear cancellation result is returned by the payment platform, the payment information is deleted.
[0060] Specifically, the time interval of the scheduled detection can be adjusted according to the application scenario. For example, the time interval can be 40s to 5min. Preferably, it can be detected every 1min whether there is payment information in the cache.
[0061] By regularly clearing payment information, the generation of one-sided accounts is reduced, and the payment information takes up as little cache space as possible, the transaction rate of the next transaction is increased. This is suitable for situations with network fluctuations and helps to process legacy payments during periods of high network signal strength.
[0062] In one embodiment, if Figure 2 and Figure 5 As shown, the real-time payment method further includes step S51.
[0063] Step S51. When the terminal is in a state of no payment action, that is, between step S40 and step S10 of the next payment, it is periodically checked whether there is payment information in the cache. If there is payment information, a request to cancel the payment is sent to the payment platform based on the payment information. If no clear cancellation result is returned by the payment platform, a network status index is obtained according to a preset algorithm. According to the network status index, it is determined whether there is a network abnormality. If there is a network abnormality, a network abnormality prompt is issued.
[0064] Specifically, the prompt of network abnormality may be a prompt sign or text on a display screen of the terminal, or a prompt sign or text on a platform or other terminal connected to the terminal.
[0065] Specifically, the preset algorithm is shown in formula (1): Y = W1*N^n + W2*(1 / T^m) + W3*(1-L^p) (1) Where Y is the network status index, N is the signal strength, T is the delay time (ms), L is the packet loss rate, w1, w2, w3 are the weights of signal strength, delay time and packet loss rate respectively, and n, m and p are constants.
[0066] Therefore, the network status is judged by comprehensively considering the signal strength, delay time and packet loss rate, and an index is introduced for calculation to more sensitively capture slight changes in network status, so as to better judge whether there is a network abnormality. In this way, users can get prompts of network abnormalities before payment, and can choose to restart the network or choose other payment methods to improve payment efficiency.
[0067] The network status index can have a preset threshold. For example, if the network status index is lower than 3.5, it means that the network is abnormal, which may affect the payment process, so a prompt is required.
[0068] For example, in a certain scenario, the signal strength is 4 (range 0-5), the delay time is 40ms, and the packet loss rate is 0.01. At the same time, the weights W1=1.5, W2=4, W3=0.7, the index n=1, m=2, p=1 are set, and these parameters are substituted into the formula to obtain a network status index of 6.6955, indicating that the network condition is good.
[0069] In one embodiment, the present application discloses a real-time payment system, which corresponds to the real-time payment method in the above embodiment.
[0070] A real-time payment system includes a payment acquisition module, a data processing module, a payment request module and a result feedback module. The detailed description of each functional module is as follows: Payment acquisition module, used to obtain payment data; A data processing module, used for converting payment data into payment information and saving the payment information to a cache; A payment request module, used to send a payment request to the payment platform according to the payment information; The result feedback module is used to receive a clear payment result returned by the payment platform, delete the payment information, and end the transaction; if no clear payment result is received, send a query request to the payment platform; receive a clear payment result returned by the payment platform, delete the payment information, and end the transaction; if no clear payment result is received, send a request to cancel payment to the payment platform based on the payment information; receive a clear cancellation result returned by the payment platform, delete the payment information, and end the transaction; if no clear cancellation result is received from the payment platform, the transaction ends.
[0071] For the specific definition of the real-time payment system, please refer to the definition of a real-time payment method above, which will not be repeated here; each module in the above-mentioned real-time payment system can be implemented in whole or in part by software, hardware and a combination thereof; each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0072] In one embodiment, a terminal device is provided, which may be a POS machine, a smart phone or a cash register. The terminal device includes a processor, a memory and a network interface connected via a system bus. The processor of the terminal device is used to provide computing and control capabilities. The memory of the terminal device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the terminal device is used to store a large amount of audio segment samples of various types, silent segment filtering rules, etc. The network interface of the terminal device is used to communicate with an external terminal and a payment platform through a network connection.
[0073] In one embodiment, a terminal device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program: S10. Obtain payment data; S20. Convert the payment data into payment information and save the payment information to the cache; S30. Send a payment request to the payment platform according to the payment information; S40. Upon receiving a clear payment result from the payment platform, delete the payment information, output the transaction result and end the transaction; if no clear payment result is received, send a query request to the payment platform; upon receiving a clear payment result from the payment platform, delete the payment information, output the transaction result and end the transaction; if no clear payment result is received, send a request to cancel payment to the payment platform based on the payment information; upon receiving a clear cancellation result from the payment platform, delete the payment information, output the transaction result and end the transaction; if no clear cancellation result is received from the payment platform, output the transaction result and end the transaction.
[0074] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented: S10. Obtain payment data; S20. Convert the payment data into payment information and save the payment information to the cache; S30. Send a payment request to the payment platform according to the payment information; S40. Upon receiving a clear payment result from the payment platform, delete the payment information, output the transaction result and end the transaction; if no clear payment result is received, send a query request to the payment platform; upon receiving a clear payment result from the payment platform, delete the payment information, output the transaction result and end the transaction; if no clear payment result is received, send a request to cancel payment to the payment platform based on the payment information; upon receiving a clear cancellation result from the payment platform, delete the payment information, output the transaction result and end the transaction; if no clear cancellation result is received from the payment platform, output the transaction result and end the transaction.
[0075] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0076] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0077] This specific implementation manner is merely an explanation of the present application and is not a limitation of the present application. After reading this specification, those skilled in the art may make non-creative modifications to the specific implementation manner as needed, but such modifications are protected by the patent law as long as they are within the scope of the claims of the present application.
Claims
1. A real-time payment method, characterized in that: The following steps are included: Obtain payment data; Convert the payment data into payment information and save the payment information to the cache; Send a payment request to the payment platform according to the payment information; Upon receiving a clear payment result from the payment platform, the payment information is deleted, the transaction result is output and the transaction is ended; if no clear payment result is received, a query request is sent to the payment platform; upon receiving a clear payment result from the payment platform, the payment information is deleted, the transaction result is output and the transaction is ended; if no clear payment result is received, a request to cancel payment is sent to the payment platform based on the payment information; upon receiving a clear cancellation result from the payment platform, the payment information is deleted, the transaction result is output and the transaction is ended; if no clear cancellation result is received from the payment platform, the transaction result is output and the transaction is ended.
2. A real-time payment method according to claim 1, characterized in that: Also includes: After obtaining the payment data and before converting it into payment information, a query is made in the cache to see whether the payment information exists. If the payment information exists, a request to cancel the payment is sent to the payment platform based on the payment information. If the payment platform returns a clear cancellation result, the payment information is deleted. If no clear cancellation result is received, the transaction ends.
3. A real-time payment method according to claim 1, characterized in that: Also includes: When there is no payment action, the cache is checked regularly to see if there is payment information. If there is payment information, a request to cancel the payment is sent to the payment platform based on the payment information. If a clear cancellation result is returned by the payment platform, the payment information is deleted.
4. A real-time payment method according to claim 1, characterized in that: Also includes: When there is no payment action, the cache is checked periodically to see whether there is payment information. If there is payment information, a request to cancel the payment is sent to the payment platform based on the payment information. If no clear cancellation result is returned by the payment platform, the network status index is obtained according to the preset algorithm. Based on the network status index, it is determined whether there is a network anomaly. If there is a network anomaly, a network anomaly prompt is issued.
5. A real-time payment method according to claim 4, characterized in that: The preset algorithm is shown in formula (1): Y = W1*N^n + W2*(1 / T^m) + W3*(1-L^p) (1) Where Y is the network status index, N is the signal strength, T is the delay time, L is the packet loss rate, w1, w2, w3 are the weights of signal strength, delay time and packet loss rate respectively, and n, m and p are constants.
6. A real-time payment method according to claim 1, characterized in that: Sending a query request to the payment platform is a polling request within a predetermined time.
7. A real-time payment system, characterized in that: include: Payment acquisition module, used to obtain payment data; A data processing module, used for converting payment data into payment information and saving the payment information to a cache; A payment request module, used to send a payment request to the payment platform according to the payment information; The result feedback module is used to receive a clear payment result returned by the payment platform, delete the payment information, and end the transaction; if no clear payment result is received, send a query request to the payment platform; receive a clear payment result returned by the payment platform, delete the payment information, and end the transaction; if no clear payment result is received, send a request to cancel payment to the payment platform based on the payment information; receive a clear cancellation result returned by the payment platform, delete the payment information, and end the transaction; if no clear cancellation result is received from the payment platform, the transaction ends.
8. A terminal device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of a real-time payment method as claimed in any one of claims 1 to 6 when executing the computer program.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of a real-time payment method as claimed in any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Transaction data processing method and device, electronic equipment and readable storage medium
CN109685508A
Transaction data processing method and device, electronic equipment and readable storage medium
CN109741069A
Order payment request exception processing method, equipment, server and system
CN110706069A
Transaction data storage method, apparatus and device, and storage medium
CN111242621A
Payment state maintenance method and system based on order callback
CN113256276A
Cited By
Power system harmonic impedance panoramic intelligent prediction system based on industrial big data
CN120342067A
