Payment communication method, system, and storage medium
By introducing the MQTT protocol and Zookeeper service into payment terminal devices and communication systems, the problems of long processing time and low success rate in payment request processing are solved, and efficient payment communication is achieved under low network quality.
Patent Information
- Application Number
- CN202310597768.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-25
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2043-05-25
AI Technical Summary
Existing payment terminal devices take a long time to process payment requests under low network quality and have a low success rate, mainly due to high-overhead, high-bandwidth communication protocols.
The low-overhead, low-bandwidth MQTT protocol is introduced, and the Zookeeper distributed coordination service is used to solve the problem of duplicate message subscriptions, enabling efficient communication between payment terminal devices and the payment communication system.
Significantly improve payment success rate under low network quality, reduce payment time, and improve the stability of payment terminal equipment.
Smart Images

Figure CN116668548B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of computers, in particular to a payment communication method, system and storage medium. BACKGROUND
[0002] The payment terminal is a device that can be used to identify payment QR codes and send payment requests to a remote payment communication system. The device also has other additional functions such as querying orders and refunds. Referring to the existing terminal device and related payment communication system architecture shown in Figure 1 The terminal device and the third-party payment communication system usually communicate through a wireless network (such as a 4G or 5G mobile network). The communication protocol is mainly a high-overhead and high-bandwidth protocol such as https (Hypertext Transfer Protocol Secure). This can introduce a serious problem. When the wireless network quality is weak, such as when the 4G network signal is poor, the bandwidth is small, and it takes a long time to send https messages to the third-party payment communication system. Moreover, payment failures frequently occur (low payment success rate). Another reason for the long time consumption is that the https message is based on a pure text message, which has a large overhead. Therefore, the existing technology has the problems of long time consumption and low payment success rate when the terminal payment device processes a payment request. SUMMARY
[0003] Therefore, the present disclosure provides a payment communication method, system and storage medium to solve the problems of long time consumption and low payment success rate by using a low-overhead and low-bandwidth communication mechanism. In the payment terminal device and the payment communication system, a low-overhead and low-bandwidth protocol such as MQTT (Message Queue Telemetry Transport) is introduced. At the same time, a distributed application coordination service Zookeeper is used to solve the technical problem of repeated subscription of payment messages. This improves the payment success rate and reduces the payment time consumption under low network quality. It realizes efficient communication between the payment terminal device and the payment communication system and improves the payment stability of the payment terminal device.
[0004] To this end, the embodiments of the present disclosure provide the following technical solutions:
[0005] According to an aspect of the present disclosure, a payment communication method is provided, which is applied to a payment system including a payment channel, at least one payment terminal device, and a third-party payment system including at least one service, the payment terminal device being configured to identify a payment code, communicate with the third-party payment system wirelessly, and send a payment request to the third-party payment system, the third-party payment system being configured to communicate with the payment channel and send the payment request to the payment channel for payment, the payment terminal device communicating with the third-party payment system based on a low-overhead and low-bandwidth communication protocol and through an intermediary server, the method including the steps of: identifying a payment code by a first payment terminal device in the payment terminal device, publishing a first payment request message including a first order number in a first topic in the intermediary server dedicated to the first payment terminal device, and recording the first order number in the first payment terminal device; subscribing to and receiving the first payment request message in the first topic by a first service of the third-party payment system, and sending the first payment request in the first payment message to the payment channel for payment, the payment channel sending a second payment success message including a second order number to the third-party payment system and distributing to the first service after the payment of the first payment request is completed, the first service publishing the second payment success message including the second order number in a second topic in the intermediary server dedicated to the first payment terminal device; subscribing to and receiving the second payment success message in the second topic by the first payment terminal device, and comparing the second order number and the first order number, if the second order number in the second payment success message received by the first payment terminal device is the same as the first order number, determining that the first payment request is successful, if the second order number in the second payment success message received by the first payment terminal device is not the same as the first order number, discarding the second payment success message and continuing to wait and receive the second payment success message in the second topic, until determining that the first payment request is successful or until waiting for more than a set time and still being unable to determine that the first payment request is successful, determining that the first payment request fails.
[0006] Further, the payment terminal device is configured to identify a payment two-dimensional code.
[0007] Further, the payment terminal device is configured to identify a payment code of a payer.
[0008] Further, the payment terminal device communicates with the third-party payment system based on a message queue transmission detection protocol MQTT and through an intermediary server broker.
[0009] Further, the third-party payment system comprises a distributed coordination server, configured to control and distribute the number of topics of service subscription in at least one service of the third-party payment system.
[0010] Further, the distributed coordination server is a zookeeper server.
[0011] Further, the first service subscription of the third-party payment system receives the first payment request message in the first topic comprises: the first service of the third-party payment system subscribes to the message in the first topic of the first service subscription through the zookeeper server and receives the first payment request message in the first topic.
[0012] Further, the payment communication method further comprises: if it is determined that the first payment request is successful, displaying payment success; if it is determined that the first payment request is failed until waiting for more than a set time, displaying payment failure.
[0013] According to another aspect of the present disclosure, a payment communication system is provided, applied to a payment system, the payment system comprising a payment channel, at least one payment terminal device, a third-party payment system comprising at least one service, the payment terminal device being configured to identify a payment code, communicate with the third-party payment system wirelessly and send a payment request to the third-party payment system, the third-party payment system being configured to communicate with the payment channel and send the payment request to the payment channel for payment, the payment terminal device communicating with the third-party payment system based on a low-overhead, low-bandwidth communication protocol and through an intermediary server, characterized in that the payment communication system comprises: at least one processor; and a memory in communication connection with the at least one processor; wherein the memory stores instructions executable by the one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute any one of the payment communication methods described above.
[0014] According to another aspect of the present disclosure, a computer readable storage medium is provided, the computer readable storage medium storing a plurality of instructions adapted to be loaded by a processor to execute any one of the payment communication methods described above.
[0015] According to the payment communication method, device and storage medium of the technical scheme of the present disclosure, the scheme of the present disclosure introduces a low-overhead and low-bandwidth protocol such as MQTT in the processing of a payment request in a payment terminal device and a payment communication system, and solves the technical problem of repeated subscription of a payment message by using a distributed coordination service such as Zookeeper, so that the payment success rate is greatly improved and the payment time consumption is greatly reduced under low network quality, efficient communication between the payment terminal device and the payment communication system is realized, and the payment stability of the payment terminal device is improved. Of course, implementing any product or method of the present disclosure does not necessarily need to achieve all the advantages described above. BRIEF DESCRIPTION OF DRAWINGS
[0016] In order to more clearly illustrate the technical scheme in the specific embodiments of the present disclosure or the prior art, the drawings needed to be used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings in the following description are some embodiments of the present disclosure, and other drawings can also be obtained by those skilled in the art without creative labor on the basis of these drawings.
[0017] The components in the drawings are not drawn to scale, but only to show the principles of the present disclosure. In order to facilitate the illustration and description of some parts of the present disclosure, the corresponding parts in the drawings may be enlarged, that is, they become larger relative to other components in the exemplary system actually manufactured according to the present disclosure. In the drawings, the same or similar technical features or components will be denoted by the same or similar reference numerals.
[0018] Figure 1 A schematic diagram of a payment communication system architecture of the prior art is shown;
[0019] Figure 2 Steps and architecture of a payment communication method according to an embodiment of the present disclosure are shown;
[0020] Figure 3 A schematic diagram of a payment communication system according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0021] The technical scheme in the embodiments of the present application will be described clearly and completely below in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, not all the embodiments. All other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0022] According to an embodiment of the present disclosure, in one embodiment, referring to Figure 2The application provides a payment communication method applied to a payment system, the payment system comprising a payment channel, three payment terminal devices (terminal device A / B / C), a third-party payment system comprising three servers and each server comprising at least one service, and a zookeeper server for controlling and distributing the number of service subscription topics, the payment terminal device is used for identifying a payment code, wirelessly communicating with the third-party payment system and sending a payment request to the third-party payment system, the third-party payment system is used for communicating with the payment channel and sending a payment request to the payment channel for payment, the payment terminal device communicates with the third-party payment system based on a low-overhead and low-bandwidth communication protocol MQTT and through a broker, the payment communication method is described below by taking the process related to the terminal device A as an example, the payment communication method comprises the following steps: after a first payment terminal device terminal device A in the payment terminal device identifies a payment code, the first payment terminal device terminal device A publishes a first payment request message comprising a first order number (order number D) of a first payment request to a first topic (topic A) special for the first payment terminal device terminal device A in a broker, and records the first order number (order number D) in the first payment terminal device terminal device A; a first service of the third-party payment system subscribes to and receives the first payment request message in the first topic (topic A), and sends the first payment request in the first payment message to the payment channel for payment, the payment channel sends a second payment success message comprising a second order number to the third-party payment system and distributes the second payment success message to the first service after the payment of the first payment request is completed, and the first service publishes the second payment success message comprising the second order number to a second topic special for the first payment terminal device terminal device A in the broker; the first payment terminal device terminal device A subscribes to and receives the second payment success message in the second topic, and compares the second order number and the first order number, if the second order number in the second payment success message received by the first payment terminal device terminal device A is the same as the first order number, it is determined that the first payment request is successful, if the second order number in the second payment success message received by the first payment terminal device terminal device A is not the same as the first order number, the second payment success message is discarded, and the first payment terminal device terminal device A continues to wait and receive the second payment success message in the second topic, until it is determined that the first payment request is successful or until the waiting exceeds a set time and the first payment request cannot be determined to be successful, then it is determined that the first payment request fails.
[0023] In some embodiments, the payment terminal device is used for identifying a payment two-dimensional code.
[0024] In some embodiments, the payment terminal device is used for identifying a payment code of a payer.
[0025] In some embodiments, referring to Figure 2The payment terminal device communicates with the third-party payment system based on a message queue transmission detection protocol (MQTT) and through a broker.
[0026] In some embodiments, referring to Figure 2 The third-party payment system comprises a distributed coordination server configured to control and allocate a number of topics of service subscriptions in at least one service of the third-party payment system.
[0027] In some embodiments, referring to Figure 2 The distributed coordination server is a zookeeper server.
[0028] In some embodiments, referring to Figure 2 The first service of the third-party payment system subscribes to and receives the first payment request message in the first topic by sensing the message subscription in the first topic of the first service subscription through the zookeeper server.
[0029] In some embodiments, the payment communication method further comprises: if it is determined that the first payment request is successful, displaying a payment success; and if it is determined that the first payment request is failed after waiting for more than a set time, displaying a payment failure.
[0030] In the implementation, the payment communication method and the payment communication system of the present disclosure are not limited to one payment terminal device, and can comprise a plurality of payment terminal devices. The technical solutions of the present disclosure can be understood with reference to the following example comprising three payment terminal devices (terminal devices A, B and C):
[0031] The entire payment introduces MQTT, and the MQTT communication protocol itself has the characteristics of low overhead and low bandwidth. Two communication links of payment request and other non-payment request are adopted, the non-payment request still adopts the prior art (see Figure 1 ) scheme, and the payment request adopts the present patent scheme. The payment flow is as follows:
[0032] After the terminal device A scans the code, the terminal device A publishes a payment request (including order details) message to the MQTT topic A special for the terminal device, and records the order number D of the last payment in the terminal device A, and waits for the payment result. The terminal device A subscribes to the message in the topic D at the same time.
[0033] Terminal device B publishes the payment request (including order details) to the MQTT topic B specific to this terminal device after scanning the code, and at the same time records the order number E of the last payment in terminal device B, and waits for the payment result, and terminal device B subscribes to the messages in topic E at the same time.
[0034] Terminal device C publishes the payment request (including order details) to the MQTT topic C specific to this terminal device after scanning the code, and at the same time records the order number F of the last payment in terminal device B, and waits for the payment result, and terminal device B subscribes to the messages in topic F at the same time.
[0035] The third-party payment communication system server A perceives by means of the Zookeeper service that it needs to subscribe to the messages in topic A, subscribes to and consumes the messages in topic A, and sends the payment request published by terminal device A to a certain payment channel for payment through the Https channel.
[0036] The third-party payment communication system server B perceives by means of the Zookeeper service that it needs to subscribe to the messages in topic B, subscribes to and consumes the messages in topic B, and sends the payment request published by terminal device B to a certain payment channel for payment through the Https channel.
[0037] The third-party payment communication system server C perceives by means of the Zookeeper service that it needs to subscribe to the messages in topic C, subscribes to and consumes the messages in topic C, and sends the payment request published by terminal device C to a certain payment channel for payment through the Https channel.
[0038] After the user completes the payment, the third-party payment communication system server A publishes the payment success message (including order number D information) to topic D, at which time terminal device A receives the payment success message, and compares order number D with the order number of the last payment, if they are equal, it displays payment success, if they are not equal, it discards the message and continues to wait for the payment result (if it waits for too long, it displays payment failure, and notifies the device user to actively query the user payment result).
[0039] After the user completes the payment, the third-party payment communication system server B publishes a payment success message (including order number E information) to topic E. At this time, the terminal device B receives the payment success message and compares the order number E with the order number of the last payment. If they are equal, the payment success is displayed. If they are not equal, the message is discarded and the payment result is continued to be waited (if the waiting time is exceeded, the payment failure is displayed and the device user is notified to actively query the user payment result).
[0040] After the user completes the payment, the third-party payment communication system server C publishes a payment success message (including order number F information) to topic F. At this time, the terminal device C receives the payment success message and compares the order number F with the order number of the last payment. If they are equal, the payment success is displayed. If they are not equal, the message is discarded and the payment result is continued to be waited (if the waiting time is exceeded, the payment failure is displayed and the device user is notified to actively query the user payment result).
[0041] The scheme of the present disclosure introduces a low-overhead and low-bandwidth protocol such as MQTT in the payment terminal device and the payment communication system, and solves the technical problem of repeated subscription of payment messages by using a distributed coordination service such as Zookeeper, so that the payment success rate is greatly improved and the payment time is greatly reduced under low network quality.
[0042] According to an embodiment of the present disclosure, a payment communication system is provided. In one embodiment, referring to Figure 3 , the payment communication system 400 includes at least one processor 401 and a memory 402 connected with the at least one processor 401; the memory 402 stores instructions executable by the at least one processor 401, and the instructions are executed by the at least one processor 401 to enable the at least one processor 401 to perform any of the payment communication methods described above. The payment communication system can be a server, a smart phone, a tablet computer, or the like. In this embodiment, the processor 401 in the payment communication system 400 loads one or more application processes corresponding instructions into the memory 402, and the processor 401 runs the application program stored in the memory 402, thereby realizing the steps of any of the payment communication methods described above.
[0043] Due to the instructions stored in the memory 402, the steps of any of the payment communication methods provided in the embodiments of the present disclosure can be performed, and thus the beneficial effects of any of the payment communication methods provided in the embodiments of the present disclosure can be achieved. Details are described above and will not be repeated here. The specific implementation of each operation can be referred to the above embodiments and will not be repeated here.
[0044] According to one embodiment of the present disclosure, a computer readable storage medium is provided. A person of ordinary skill in the art can understand that all or part of the steps in the above-mentioned embodiments can be completed by instructions, or by relevant hardware controlled by the instructions, which can be stored in a computer readable storage medium and loaded and executed by a processor. Therefore, the embodiments of the present application provide a storage medium, in which a plurality of instructions are stored, which can be loaded by a processor to execute the steps of any one of the payment communication methods provided by the embodiments of the present application.
[0045] The storage medium can include a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and more specifically, can include specific categories such as a static random access memory (SRAM) and a dynamic random access memory (DRAM). , SRAM) and a dynamic random access memory (DRAM).
[0046] Due to the instructions stored in the storage medium, the steps of any one of the payment communication methods provided by the embodiments of the present application can be executed, and thus the beneficial effects of any one of the payment communication methods provided by the embodiments of the present application can be achieved, which are described in detail in the foregoing embodiments and will not be described here again. The specific implementation of each operation can refer to the foregoing embodiments, and will not be described here again.
[0047] According to the above description, the technical effects of the present disclosure are: to provide a payment communication method, a payment communication system and a computer readable storage medium. Compared with the prior art, the scheme of the present disclosure introduces a low-overhead and low-bandwidth MQTT protocol in the processing of payment requests in the payment terminal device and the payment communication system, and simultaneously uses a distributed coordination service such as Zookeeper to solve the technical problem of repeated subscription of payment messages, so that the payment success rate is greatly improved and the payment time consumption is greatly reduced under low network quality, the payment terminal device and the payment communication system are efficiently communicated, and the payment stability of the payment terminal device is improved.
[0048] The above only describes the embodiments of the present application and does not limit the present application. Any modification, equivalent replacement and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.
[0049] Those skilled in the art can understand that the above description does not constitute a limitation on the system, and can include more or fewer components, or combine certain components, or different component arrangements.
[0050] It should be noted that, in the description of the present application, the terms "first", "second", etc. are used only for descriptive purposes and are not to be construed as indicating or implying relative importance or an indicated number of technical features. Thus, features defined with "first", "second" can explicitly or implicitly include one or more features. In the description of the present application, the meaning of "a plurality of" is two or more, unless otherwise explicitly and specifically limited. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such a process, method, article or device. Without more limitations, the element defined by the statement "including one" does not exclude the presence of another identical element in the process, method, article or device including the above-mentioned element. Each embodiment in the specification is described in a relevant manner, and the same or similar parts between each embodiment can be referred to each other, and each embodiment focuses on the difference from other embodiments. In particular, for system and payment communication system embodiments, since they are basically similar to method embodiments, the description is relatively simple, and the relevant parts can be referred to the part of the method embodiment. The above is only an embodiment of the present disclosure, and is not used to limit the protection scope of the present disclosure. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present disclosure is included in the protection scope of the present disclosure. In the above description of the specific embodiments of the present disclosure, the features described and / or shown for one implementation can be used in the same or similar manner in one or more other implementations, combined with the features in other implementations, or replaced by the features in other implementations.
[0051] In the present application, the word "exemplary" is used to mean "serving as an example, instance, or illustration." Any implementation described as "exemplary" in the present application is not necessarily to be construed as preferred or advantageous over other implementations. The following description is presented to enable any person skilled in the art to make and use the present application. In the following description, for the purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the present application. It should be apparent to one skilled in the art, however, that the present application can be practiced without using these specific details. In other instances, well-known structures and processes are not elaborated upon in order to avoid unnecessary detail, which can obscure the description of the present application. Accordingly, the present application is not intended to be limited by the embodiments shown, but is to be accorded the widest scope consistent with the principles and features disclosed herein.
[0052] It should be emphasized that the term "comprises / comprising" when used in this specification is taken to mean the presence of stated features, elements, steps or components but does not preclude the presence or addition of one or more other features, elements, steps, components or groups thereof. The term "a" or "an" preceding an element does not exclude the presence of more than one of that element. Recitation of ranges of values herein are merely intended to serve as a shorthand method of referring individually to each separate value falling within the range, unless the context indicates otherwise. Unless otherwise indicated, all ranges included integers within the range. The use of "about" or "approximately" in connection with a value means that the exact value can be the recited value or a value that is within an acceptable measurement error range for the particular measurement technique used to determine the value.
[0053] While embodiments of the present disclosure have been described in connection with the preferred embodiments of the various figures, modifications and / or additions, which do not depart from the spirit and scope of the present disclosure, are intended to be within the scope of the claims.
Claims
1. A payment communication method applied to a payment system, the payment system comprising a payment channel, at least one payment terminal device, a third-party payment system comprising at least one service, the payment terminal device being configured to identify a payment code, communicate with the third-party payment system wirelessly and send a payment request to the third-party payment system, the third-party payment system being configured to communicate with the payment channel and send the payment request to the payment channel for payment, characterized in that, The payment terminal device communicates with the third-party payment system based on a message queue transmission detection protocol MQTT and through a broker, and the third-party payment system includes a distributed coordination server configured to control and distribute a number of service subscriptions of a topic in at least one service of the third-party payment system, and the method comprises the steps of: The first payment terminal device in the payment terminal device publishes a first payment request message including a first order number to a first topic in the broker, and records the first order number in the first payment terminal device after identifying a payment code; The first service of the third-party payment system subscribes to and receives the first payment request message in the first topic, and sends the first payment request in the first payment request message to the payment channel for payment, and the payment channel sends a second payment success message including a second order number to the third-party payment system and to the first service after the payment of the first payment request is completed, and the first service publishes the second payment success message including the second order number to a second topic in the broker, which is specific to the first payment terminal device; The first payment terminal device subscribes to and receives the second payment success message in the second topic, and compares the second order number and the first order number, and if the second order number in the second payment success message received by the first payment terminal device is the same as the first order number, it is determined that the first payment request is successful, if the second order number in the second payment success message received by the first payment terminal device is not the same as the first order number, the second payment success message is discarded, and the first payment terminal device continues to wait and receive the second payment success message in the second topic, until it is determined that the first payment request is successful or until it is determined that the first payment request is unsuccessful after waiting for more than a set time; if it is determined that the first payment request is successful, a payment success is displayed, and if it is determined that the first payment request is unsuccessful after waiting for more than a set time, a payment failure is displayed.
2. The payment communication method according to claim 1, characterized by, The payment terminal device is configured to identify a payment two-dimensional code.
3. The payment communication method of claim 1, wherein, The payment terminal device is configured to identify a payment code of a payer.
4. The payment communication method of claim 1, wherein, The distributed coordination server is a zookeeper server.
5. The payment communication method according to claim 4, characterized by, The first service of the third-party payment system subscribes to and receives the first payment request message in the first topic includes: The first service of the third-party payment system subscribes to and receives the first payment request message in the first topic through the zookeeper server.
6. A payment communication system applied to a payment system, the payment system comprising a payment channel, at least one payment terminal device, a third-party payment system comprising at least one service, the payment terminal device being configured to identify a payment code, communicate with the third-party payment system wirelessly and send a payment request to the third-party payment system, the third-party payment system being configured to communicate with the payment channel and send the payment request to the payment channel for payment, the payment terminal device communicating with the third-party payment system based on a Message Queue Telemetry Transport (MQTT) protocol and through a broker, the third-party payment system comprising a distributed coordination server configured to control and allocate a number of topics subscribed by a service in the at least one service in the third-party payment system. The payment communication system comprises at least one processor and a memory connected with the at least one processor in communication; wherein the memory stores instructions executable by the one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the payment communication method in any one of claims 1-5.
7. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a plurality of instructions adapted to be loaded by a processor to perform the payment communication method in any one of claims 1-5.
Citation Information
Patent Citations
Payment method, client, payment server and payment system
CN116155972A