CN116915723A - Asynchronous processing method and device for payment result message - Google Patents

Asynchronous processing method and device for payment result message Download PDF

Info

Publication number
CN116915723A
CN116915723A CN202310806994.5A CN202310806994A CN116915723A CN 116915723 A CN116915723 A CN 116915723A CN 202310806994 A CN202310806994 A CN 202310806994A CN 116915723 A CN116915723 A CN 116915723A
Authority
CN
China
Prior art keywords
target
message
payment
payment result
queue
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310806994.5A
Other languages
Chinese (zh)
Inventor
徐世泽
黄颖欣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Bank of China Ltd
Original Assignee
Bank of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Bank of China Ltd filed Critical Bank of China Ltd
Priority to CN202310806994.5A priority Critical patent/CN116915723A/en
Publication of CN116915723A publication Critical patent/CN116915723A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/50Queue scheduling
    • H04L47/62Queue scheduling characterised by scheduling criteria
    • H04L47/6295Queue scheduling characterised by scheduling criteria using multiple queues, one for each individual QoS, connection, flow or priority
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes

Abstract

The application discloses a method and a device for asynchronously processing a payment result message, which can be applied to the financial field or other fields. The server configures a plurality of first message queues, different first message queues correspond to different payment service types, and the server obtains a target payment result message; determining a target first message queue corresponding to the target payment service type from a plurality of first message queues according to the target payment service type of the target payment result message; storing the target payment result message into a target first message queue, and sending a synchronous storage instruction to the payment device, wherein the synchronous storage instruction is used for synchronously storing the target payment result message into a target second message queue which is configured on the payment device and corresponds to the target first message queue, so that the payment device can acquire the target payment result message from the target second message queue. It can be seen that the method enables decoupling of the payment device and the server, and high performance processing and highly reliable transmission of payment result messages.

Description

Asynchronous processing method and device for payment result message
Technical Field
The present application relates to the field of message processing technologies, and in particular, to a method and an apparatus for asynchronous processing of a payment result message.
Background
At present, payment relates to a payment device, a server and the like, after receiving a payment request message, the server firstly synchronously returns a payment processing message to the payment device, and after processing is finished and a payment result message is obtained, the payment result message is asynchronously returned to the payment device.
In the related art, the server asynchronously returning the payment result message to the payment device generally means that the server provides a socket to the payment device, and the payment device establishes a connection with the server through the socket to poll for the payment result message; or the server returns the payment result message to the payment equipment through the socket.
However, the above-mentioned connection manner between the payment device and the server through socket has a disadvantage of tight coupling between the payment device and the server, and as the amount of paid traffic increases concurrently, the processing speed of the payment result message is limited; and the transmission of the payment result message through the socket is influenced by the network, so that the conditions of message loss, overtime failure and the like are easy to occur.
Disclosure of Invention
In view of this, the embodiment of the application provides a method and a device for asynchronous processing of a payment result message, which realize decoupling of a payment device and a server; even if the concurrent increase of the payment traffic is carried out, the payment result message can be processed with high performance; and a payment result message is transmitted with high reliability.
In a first aspect, an embodiment of the present application provides a method for asynchronous processing of a payment result message, which is applied to a server, where the server configures a plurality of first message queues, and different first message queues correspond to different payment service types, and the method includes:
obtaining a target payment result message;
determining a target first message queue corresponding to the target payment service type from the plurality of first message queues according to the target payment service type of the target payment result message;
storing the target payment result message to the target first message queue, and sending a synchronous storage instruction to a payment device; the synchronous storage instruction is used for synchronously storing the target payment result message to a target second message queue which is configured in the payment equipment and corresponds to the target first message queue.
Optionally, the target payment result message further carries a target deletion condition, where the target deletion condition is determined according to a target payment service type of the target payment result message, and the method further includes:
receiving a synchronous deleting instruction; the synchronous deleting instruction is sent by the payment equipment when the target payment result message is deleted from the target second message queue and the target deleting condition is met;
And synchronously deleting the target payment result message from the target first message queue according to the synchronous deleting instruction.
Optionally, when the target payment service type is a one-time payment type, the target deletion condition is that the payment device obtains the target payment result message from the target second message queue; when the target payment service type is a multiple payment type, the target deletion condition is that the accumulated times of the target payment result information obtained by the payment equipment from the target second information queue are equal to the preset times of the multiple payment type configuration, or the storage time of the target payment result in the target second information queue is equal to the preset time of the multiple payment type configuration.
Optionally, the server further configures a subscription message queue, and the method further includes:
obtaining a target notification message of the target payment result message;
storing the target notification message to the subscription message queue and sending the target notification message to the payment device.
In a second aspect, an embodiment of the present application provides an asynchronous processing method for a payment result message, which is applied to a payment device, where the payment device configures a plurality of second message queues, and different second message queues correspond to different payment service types, and includes:
Receiving a synchronous storage instruction; the synchronous storage instruction is sent by the server when target payment result information is stored in a target first information queue in a plurality of first information queues configured in the server, and the target first information queue is determined according to the target payment service type of the target payment result information;
according to the synchronous storage instruction, synchronously storing target payment result information in target second message queues corresponding to the target first message queues in a plurality of second message queues;
and acquiring the target payment result message from the target second message queue.
Optionally, the target payment result message further carries a target deletion condition, where the target deletion condition is determined according to a target payment service type of the target payment result message, and the method further includes:
deleting the target payment result message from the target second message queue if the target deletion condition is met, and sending a synchronous deletion instruction to a server; the synchronous deleting instruction is used for synchronously deleting the target payment result message from the target first message queue.
Optionally, when the target payment service type is a one-time payment type, the target deletion condition is that the payment device obtains the target payment result message from the target second message queue; when the target payment service type is a multiple payment type, the target deletion condition is that the accumulated times of the target payment result information obtained by the payment equipment from the target second information queue are equal to the preset times of the multiple payment type configuration, or the storage time of the target payment result in the target second information queue is equal to the preset time of the multiple payment type configuration.
Optionally, the method further comprises:
receiving a target notification message of the target payment result message; the target notification message is sent by the server when being stored in a subscription message queue of the configuration server;
the obtaining the target payment result message from the target second message queue specifically includes:
and acquiring the target payment result message from the target second message queue according to the target notification message.
In a third aspect, an embodiment of the present application provides an asynchronous processing device for a payment result message, which is applied to a server, where the server configures a plurality of first message queues, and different first message queues correspond to different payment service types, and includes: an obtaining unit, a determining unit and a first storage unit;
the obtaining unit is used for obtaining a target payment result message;
the determining unit is used for determining a target first message queue corresponding to the target payment service type from a plurality of first message queues according to the target payment service type of the target payment result message;
the storage and transmission unit is used for storing the target payment result message to the target first message queue and transmitting a synchronous storage instruction to the payment equipment; the synchronous storage instruction is used for synchronously storing the target payment result message to a target second message queue which is configured in the payment equipment and corresponds to the target first message queue.
In a fourth aspect, an embodiment of the present application provides an asynchronous processing apparatus for a payment result message, which is applied to a payment device, where the payment device configures a plurality of second message queues, and different second message queues correspond to different payment service types, and includes: the device comprises a receiving unit, a storage unit and an acquisition unit;
the first receiving unit is used for receiving the synchronous storage instruction; the synchronous storage instruction is sent by the server when target payment result information is stored in a target first information queue in a plurality of first information queues configured in the server, and the target first information queue is determined according to the target payment service type of the target payment result information;
the storage unit is used for synchronously storing target payment result messages in target second message queues corresponding to the target first message queues in a plurality of second message queues according to the synchronous storage instruction;
the obtaining unit is configured to obtain the target payment result message from the target second message queue.
Compared with the prior art, the application has at least the following advantages:
by adopting the technical scheme of the embodiment of the application, the server configures a plurality of first message queues, different first message queues correspond to different payment service types, and the server obtains a target payment result message; determining a target first message queue corresponding to the target payment service type from a plurality of first message queues according to the target payment service type of the target payment result message; storing the target payment result message into a target first message queue, and sending a synchronous storage instruction to the payment device, wherein the synchronous storage instruction is used for synchronously storing the target payment result message into a target second message queue which is configured on the payment device and corresponds to the target first message queue, so that the payment device can acquire the target payment result message from the target second message queue. The method comprises the steps that message queues are configured for the server and the payment equipment, and the server synchronizes the payment result message to the message queues configured for the payment equipment through the configured message queues, so that decoupling of the payment equipment and the server is realized; even if the concurrent increase of the payment traffic volume, the payment result message can be processed with high performance and transmitted with high reliability.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments of the present application will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments described in the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic diagram of a system frame related to an application scenario in an embodiment of the present application;
FIG. 2 is a flow chart of an asynchronous processing method for payment result messages according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of an asynchronous processing device for payment result messages according to an embodiment of the present application;
FIG. 4 is a schematic diagram of an asynchronous processing device for payment result messages according to another embodiment of the present application;
fig. 5 is a schematic diagram of an architecture for asynchronous processing of a payment result message according to an embodiment of the present application.
Detailed Description
In order to make the present application better understood by those skilled in the art, the following description will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings, and it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
At present, after receiving a payment request message sent by a payment device, a server firstly synchronously returns a payment processing message to the payment device, and after processing is finished and a payment result message is obtained, a socket is provided for the basis of the payment device based on the server, and the payment device establishes connection with the server through the socket so as to poll and inquire the payment result message; or the server returns the payment result message to the payment equipment through the socket.
However, through researches, the defect of tight coupling between the payment device and the server exists in the connection mode of socket between the payment device and the server, and the processing speed of the payment result message is limited as the payment traffic is increased concurrently; and the transmission of the payment result message through the socket is influenced by the network, so that the conditions of message loss, overtime failure and the like are easy to occur.
In order to solve the problem, in the embodiment of the application, a server configures a plurality of first message queues, different first message queues correspond to different payment service types, and the server obtains a target payment result message; determining a target first message queue corresponding to the target payment service type from a plurality of first message queues according to the target payment service type of the target payment result message; storing the target payment result message into a target first message queue, and sending a synchronous storage instruction to the payment device, wherein the synchronous storage instruction is used for synchronously storing the target payment result message into a target second message queue which is configured on the payment device and corresponds to the target first message queue, so that the payment device can acquire the target payment result message from the target second message queue. The method comprises the steps that message queues are configured for the server and the payment equipment, and the server synchronizes the payment result message to the message queues configured for the payment equipment through the configured message queues, so that decoupling of the payment equipment and the server is realized; even if the concurrent increase of the payment traffic volume, the payment result message can be processed with high performance and transmitted with high reliability.
For example, one of the scenarios of the embodiments of the present application may be applied to the scenario shown in fig. 1. The scenario includes a server 101 and a payment device 102, the server 101 configuring a plurality of first message queues, different first message queues corresponding to different payment service types, the payment device configuring a plurality of second message queues, different second message queues corresponding to different payment service types. The server 101 obtains a target payment result message; the server 101 determines a target first message queue corresponding to the target payment service type from the plurality of first message queues according to the target payment service type of the target payment result message; the server 101 stores the target payment result message to the target first message queue and transmits a synchronization store instruction to the payment device 102. The payment device 102 receives the synchronous storage instruction; the payment device 102 synchronously stores the target payment result message in a target second message queue corresponding to the target first message queue in the plurality of second message queues according to the synchronous storage instruction; the payment device 102 obtains the target payment result message from the target second message queue.
First, in the above application scenario, although the description of the actions of the implementation provided by the embodiment of the present application is performed by the server 101 and the payment device 102; however, the embodiment of the present application is not limited in terms of execution subject, and the operations disclosed in the embodiments provided by the embodiment of the present application may be executed.
Next, the above-described scenario is merely one example of a scenario provided by the embodiment of the present application, and the embodiment of the present application is not limited to this scenario.
It should be noted that the method and the device for asynchronous processing of payment result messages provided by the application can be used in the financial field or other fields, for example, can be used in payment application scenes in the financial field. Other fields are any field other than the financial field, for example, the payment field. The foregoing is merely exemplary, and is not intended to limit the application of the present application.
The following describes in detail, by way of example, a specific implementation manner of the asynchronous processing method and apparatus for payment result message in the embodiment of the present application with reference to the accompanying drawings.
Referring to fig. 2, a flow chart of an asynchronous processing method of a payment result message in an embodiment of the application is shown. In the embodiment of the present application, the server configures a plurality of first message queues, different first message queues correspond to different payment service types, the payment device configures a plurality of second message queues, different second message queues correspond to different payment service types, and the method may, for example, include the following steps:
step 201: the server obtains the target payment result message.
In the embodiment of the application, the payment scene relates to the payment equipment and the server, the payment equipment sends the target payment request message to the server, after the server receives the target payment request message, the server firstly synchronously returns the target payment processing message to the payment equipment in response to the target payment request message, and carries out relevant processing according to the target payment request message, and the target payment result message can be obtained after the processing is finished.
Step 202: and the server determines a target first message queue corresponding to the target payment service type from the plurality of first message queues according to the target payment service type of the target payment result message.
In the related art, a server provides a socket to a payment device, and the payment device establishes a connection with the server through the socket so as to poll and inquire a target payment result message; or the server returns the target payment result message to the payment equipment through the socket. Through researches, the defect of tight coupling between the payment equipment and the server exists in the connection mode of the socket between the payment equipment and the server, and the processing speed of a target payment result message is limited as the payment traffic is increased concurrently; and the transmission of the target payment result message through the socket is influenced by the network, so that the situations of message loss, overtime failure and the like are easy to occur.
In the embodiment of the application, in order to avoid transmitting the target payment result message between the server and the payment device through the socket, the server can configure a plurality of first message queues, different first message queues correspond to different payment service types, the payment device can also configure a plurality of second message queues, different second message queues correspond to different payment service types, and the plurality of first message queues correspond to the plurality of second message queues, so that the server synchronizes the target payment result message to the second message queues configured by the payment device through the configured first message queues.
After the server obtains the target payment result message in step 201, the server needs to find the first message queue corresponding to the target payment service type in the plurality of first message queues as the target first message queue through the target payment service type of the target payment result message because the plurality of first message queues configured in the server correspond to the plurality of payment service types.
Step 203: the server stores the target payment result information into a target first information queue and sends a synchronous storage instruction to the payment equipment; the synchronous storage instruction is used for synchronously storing the target payment result message to a target second message queue which is configured on the payment equipment and corresponds to the target first message queue.
In the embodiment of the present application, after determining the target first message queue in step 202, in order to enable the server to synchronize the target payment result message to the second message queue configured by the payment device through the first message queue configured by the server, the server needs to store the target payment result message to the target first message queue and send a synchronization storage instruction to the payment device, where the function of the synchronization storage instruction is to store the target payment result message to the target second message queue configured in the payment device and corresponding to the target first message queue in a synchronized manner.
In the mode, the server configures a plurality of first message queues corresponding to a plurality of different payment service types, and stores the target payment result message into the target first message queue corresponding to the target payment service type of the target payment result message, so that different payment result messages corresponding to different payment service types can be prevented from accessing the same first message queue, and the processing performance of the message queue is improved.
Step 204: the payment device receives the synchronous storage instruction.
In the embodiment of the present application, the server sends the synchronous storage instruction to the payment device in step 203, and the payment device receives the synchronous storage instruction sent by the server.
Step 205: and the payment equipment synchronously stores the target payment result message in the target second message queue according to the synchronous storage instruction.
In the embodiment of the present application, after the payment device receives the synchronous storage instruction in step 204, the synchronous storage instruction is used to synchronously store the target payment result message to the target second message queue corresponding to the target first message queue configured in the payment device; therefore, the payment device can synchronously store the target payment result message to the target second message queue through the synchronous storage instruction, so that the server can synchronously store the target payment result message to the second message queue configured by the payment device through the first message queue configured by the server.
Step 206: the payment device obtains the target payment result message from the target second message queue.
In the embodiment of the present application, after executing step 205, the payment device synchronously stores the target payment result message in the target second message queue, the payment device may actively acquire the target payment result message from the configured target second message queue.
In the method, a server synchronizes a target payment result message to a target second message queue configured by a payment device through a target first message queue configured by the server, so that decoupling of the payment device and the server is realized; even if the concurrent increase of the payment traffic volume, the target payment result message can be processed with high performance and transmitted with high reliability.
In addition, in the embodiment of the application, the characteristic that the message stored in the message queue has delay visibility can be utilized to set different deleting conditions for different payment result messages corresponding to different payment service types for classified deleting management, for example, the target deleting conditions corresponding to the target payment result message are determined according to the target payment service type of the target payment result message, and the target payment result message carries the target deleting conditions. Based on the above, when the payment device determines that the target deletion condition is met, the payment device indicates that the target payment result message stored in the target second message queue is consumed by the payment device, and the target payment result message deleted from the target second message queue can be deleted, and a synchronous deletion instruction is sent to the server, where the effect of the synchronous deletion instruction is to synchronously delete the target payment result message from the target first message queue. Thus, in an alternative implementation manner of the embodiment of the present application, the target payment result message further carries a target deletion condition, where the target deletion condition is determined according to the target payment service type of the target payment result message, and the method may further include, for example, step a: if the target deleting condition is met, the payment equipment deletes the target payment result message from the target second message queue and sends a synchronous deleting instruction to the server; the synchronous deleting instruction is used for synchronously deleting the target payment result message from the target first message queue.
When the target payment service type is a one-time payment type, the target payment result information stored in the target second message queue is deleted immediately after being consumed by the payment device once, namely, the target deletion condition is that the payment device acquires the target payment result information from the target second message queue, and the target payment result information can be deleted from the target second message queue immediately when the target deletion condition is met.
When the target payment service type is a multiple payment type, the target payment result information stored in the target second message queue needs to be repeatedly consumed by the payment device for deleting or waiting for a certain time to be automatically deleted, namely, the target deleting condition is that the accumulated times of the target payment result information obtained by the payment device from the target second message queue is equal to the preset times of multiple payment type configuration, or the storage time of the target payment result in the target second message queue is equal to the preset time of multiple payment type configuration, and the target payment result information can be deleted from the target second message queue only when the target deleting condition is met.
Therefore, in an optional implementation manner of the embodiment of the present application, when the target payment service type is a one-time payment type, the target deletion condition is that the payment device obtains the target payment result message from the target second message queue; when the target payment service type is the multiple payment type, the target deletion condition is that the accumulated times of the target payment result information obtained by the payment equipment from the target second information queue is equal to the preset times of the multiple payment type configuration, or the storage time of the target payment result in the target second information queue is equal to the preset time of the multiple payment type configuration.
Corresponding to the step A, the payment equipment sends a synchronous deleting instruction to the server, and the server receives the synchronous deleting instruction sent by the payment equipment, wherein the synchronous deleting instruction is used for synchronously deleting the target payment result message from the target first message queue; thus, the server synchronously deletes the target payment result message from the target first message queue by the synchronous deletion instruction. Thus, in an alternative implementation manner of the embodiment of the present application, the target payment result message further carries a target deletion condition, where the target deletion condition is determined according to the target payment service type of the target payment result message, and the method may further include, for example, the following steps B-C:
and (B) step (B): the server receives a synchronous deleting instruction;
step C: and the server synchronously deletes the target payment result message from the target first message queue according to the synchronous deletion instruction.
In addition, in the embodiment of the present application, a subscription message queue may be configured in the server, based on which the server obtains a target notification message of the target payment result message, stores the target notification message in the subscription message queue, and sends the target notification message to the payment device, so that the payment device obtains the target payment result message from the target second message queue through the target notification message. Thus, in an alternative implementation manner of the embodiment of the present application, the server further configures a subscription message queue, and the method may further include, for example, the following step D-step E:
Step D: the server obtains a target notification message of the target payment result message;
step E: the server stores the target notification message in a subscription message queue and sends the target notification message to the payment device.
The payment device receives the target notification message sent by the server, and the payment device can determine that the configured target second message queue stores the target payment result message according to the target notification message, so as to acquire the target payment result message from the target second message queue. Thus, in an alternative implementation of the embodiment of the present application, the method may further include, for example, step F: the payment equipment receives a target notification message of a target payment result message; correspondingly, step 206 may be, for example, specifically: and the payment equipment acquires the target payment result message from the target second message queue according to the target notification message.
Through the various implementations provided in this embodiment, the server configures a plurality of first message queues, different first message queues correspond to different payment service types, and the server obtains a target payment result message; determining a target first message queue corresponding to the target payment service type from a plurality of first message queues according to the target payment service type of the target payment result message; storing the target payment result message into a target first message queue, and sending a synchronous storage instruction to the payment device, wherein the synchronous storage instruction is used for synchronously storing the target payment result message into a target second message queue which is configured on the payment device and corresponds to the target first message queue, so that the payment device can acquire the target payment result message from the target second message queue. The method comprises the steps that message queues are configured for the server and the payment equipment, and the server synchronizes the payment result message to the message queues configured for the payment equipment through the configured message queues, so that decoupling of the payment equipment and the server is realized; even if the concurrent increase of the payment traffic volume, the payment result message can be processed with high performance and transmitted with high reliability.
Referring to fig. 3, a schematic structural diagram of an asynchronous processing device for payment result messages in an embodiment of the present application is shown. In this embodiment, the device is applied to a server, where the server configures a plurality of first message queues, and different first message queues correspond to different payment service types, and the device may specifically include: an acquisition unit 301, a determination unit 302, and a first storage unit 303;
an obtaining unit 301, configured to obtain a target payment result message;
a determining unit 302, configured to determine, according to the target payment service type of the target payment result message, a target first message queue corresponding to the target payment service type from the plurality of first message queues;
a storage transmitting unit 303, configured to store the target payment result message in a target first message queue, and transmit a synchronous storage instruction to the payment device; the synchronous storage instruction is used for synchronously storing the target payment result message to a target second message queue which is configured on the payment equipment and corresponds to the target first message queue.
In an optional implementation manner of the embodiment of the present application, the target payment result message further carries a target deletion condition, where the target deletion condition is determined according to a target payment service type of the target payment result message, and the apparatus further includes: a second receiving unit and a first deleting unit;
The second receiving unit is used for receiving the synchronous deleting instruction; the synchronous deleting instruction is sent by the payment equipment when the target payment result message is deleted from the target second message queue under the condition that the target deleting condition is met;
and the first deleting unit is used for synchronously deleting the target payment result message from the target first message queue according to the synchronous deleting instruction.
In an optional implementation manner of the embodiment of the present application, when the target payment service type is a one-time payment type, the target deletion condition is that the payment device obtains a target payment result message from the target second message queue; when the target payment service type is the multiple payment type, the target deletion condition is that the accumulated times of the target payment result information obtained by the payment equipment from the target second information queue is equal to the preset times of the multiple payment type configuration, or the storage time of the target payment result in the target second information queue is equal to the preset time of the multiple payment type configuration.
In an optional implementation manner of the embodiment of the present application, the server further configures a subscription message queue, and the apparatus further includes: a transmitting unit;
an obtaining unit 301, configured to obtain a target notification message of the target payment result message;
And the sending unit is used for storing the target notification message into the subscription message queue and sending the target notification message to the payment equipment.
Through the various implementations provided in this embodiment, the server configures a plurality of first message queues, different first message queues correspond to different payment service types, and the server obtains a target payment result message; determining a target first message queue corresponding to the target payment service type from a plurality of first message queues according to the target payment service type of the target payment result message; storing the target payment result message into a target first message queue, and sending a synchronous storage instruction to the payment device, wherein the synchronous storage instruction is used for synchronously storing the target payment result message into a target second message queue which is configured on the payment device and corresponds to the target first message queue, so that the payment device can acquire the target payment result message from the target second message queue. The server and the payment equipment configure message queues, and the server synchronizes the payment result message to the message queues configured by the payment equipment through the message queues configured by the server, so that decoupling of the payment equipment and the server is realized; even if the concurrent increase of the payment traffic volume, the payment result message can be processed with high performance and transmitted with high reliability.
Referring to fig. 4, a schematic structural diagram of another asynchronous processing device for payment result messages in an embodiment of the present application is shown. In this embodiment, the payment device is applied to a payment device, where the payment device configures a plurality of second message queues, and different second message queues correspond to different payment service types, and the apparatus may specifically include: a first receiving unit 401, a storage unit 402, and an acquisition unit 403;
a first receiving unit 401 for receiving a synchronous storage instruction; the synchronous storage instruction is sent by the server when the target payment result message is stored in a target first message queue in a plurality of first message queues configured in the server, and the target first message queue is determined according to the target payment service type of the target payment result message;
a storage unit 402, configured to store, according to the synchronous storage instruction, a target payment result message synchronously in a target second message queue corresponding to the target first message queue in the plurality of second message queues;
an obtaining unit 403, configured to obtain the target payment result message from the target second message queue.
In an optional implementation manner of the embodiment of the present application, the target payment result message further carries a target deletion condition, where the target deletion condition is determined according to a target payment service type of the target payment result message, and the apparatus further includes: a second deletion unit;
The second deleting unit is used for deleting the target payment result message from the target second message queue and sending a synchronous deleting instruction to the server if the target deleting condition is met; the synchronous deleting instruction is used for synchronously deleting the target payment result message from the target first message queue.
In an optional implementation manner of the embodiment of the present application, when the target payment service type is a one-time payment type, the target deletion condition is that the payment device obtains a target payment result message from the target second message queue; when the target payment service type is the multiple payment type, the target deletion condition is that the accumulated times of the target payment result information obtained by the payment equipment from the target second information queue is equal to the preset times of the multiple payment type configuration, or the storage time of the target payment result in the target second information queue is equal to the preset time of the multiple payment type configuration.
In an optional implementation manner of the embodiment of the present application, the first receiving unit 401 is further configured to receive a target notification message of the target payment result message; the target notification message is sent by the server when stored in a subscription message queue of the configuration server;
the obtaining unit 403 is further configured to obtain the target payment result message from the target second message queue according to the target notification message.
Through the various implementations provided in this embodiment, the server configures a plurality of first message queues, different first message queues correspond to different payment service types, and the server obtains a target payment result message; determining a target first message queue corresponding to the target payment service type from a plurality of first message queues according to the target payment service type of the target payment result message; storing the target payment result message into a target first message queue, and sending a synchronous storage instruction to the payment device, wherein the synchronous storage instruction is used for synchronously storing the target payment result message into a target second message queue which is configured on the payment device and corresponds to the target first message queue, so that the payment device can acquire the target payment result message from the target second message queue. The server and the payment equipment configure message queues, and the server synchronizes the payment result message to the message queues configured by the payment equipment through the message queues configured by the server, so that decoupling of the payment equipment and the server is realized; even if the concurrent increase of the payment traffic volume, the payment result message can be processed with high performance and transmitted with high reliability.
In addition, referring to fig. 5, an architecture diagram of asynchronous processing of payment result messages is shown, wherein the architecture diagram mainly includes modules such as a message queue cluster, a message producer, a message consumer, and a daemon thread.
Wherein, the message queue cluster is configured with each message queue in advance; the message producer is in charge of producing a target payment result message, and writes the target payment result message into a corresponding target first message queue according to the target payment service type of the target payment result message; the message consumer is responsible for acquiring a target payment result message; in addition, in the case that the message consumer subscribes to the target notification message of the target payment result message, writing the target notification message of the target payment result message into the subscription message queue so as to notify the message consumer; the daemon thread is responsible for monitoring the running states of the message producer and the message consumer, and has abnormality for thread wakeup or thread restarting.
In the present specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, and identical and similar parts between the embodiments are all enough to refer to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative elements and steps are described above generally in terms of functionality in order to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. The terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above description is only of the preferred embodiment of the present application, and is not intended to limit the present application in any way. While the application has been described with reference to preferred embodiments, it is not intended to be limiting. Any person skilled in the art can make many possible variations and modifications to the technical solution of the present application or modifications to equivalent embodiments using the methods and technical contents disclosed above, without departing from the scope of the technical solution of the present application. Therefore, any simple modification, equivalent variation and modification of the above embodiments according to the technical substance of the present application still fall within the scope of the technical solution of the present application.

Claims (10)

1. An asynchronous processing method of a payment result message is characterized by being applied to a server, wherein the server configures a plurality of first message queues, and different first message queues correspond to different payment service types and comprise the following steps:
obtaining a target payment result message;
determining a target first message queue corresponding to the target payment service type from the plurality of first message queues according to the target payment service type of the target payment result message;
storing the target payment result message to the target first message queue, and sending a synchronous storage instruction to a payment device; the synchronous storage instruction is used for synchronously storing the target payment result message to a target second message queue which is configured in the payment equipment and corresponds to the target first message queue.
2. The method of claim 1, wherein the target payment result message further carries a target deletion condition, the target deletion condition being determined based on a target payment service type of the target payment result message, the method further comprising:
receiving a synchronous deleting instruction; the synchronous deleting instruction is sent by the payment equipment when the target payment result message is deleted from the target second message queue and the target deleting condition is met;
And synchronously deleting the target payment result message from the target first message queue according to the synchronous deleting instruction.
3. The method according to claim 2, wherein when the target payment service type is a one-time payment type, the target deletion condition is that the payment device obtains the target payment result message from the target second message queue; when the target payment service type is a multiple payment type, the target deletion condition is that the accumulated times of the target payment result information obtained by the payment equipment from the target second information queue are equal to the preset times of the multiple payment type configuration, or the storage time of the target payment result in the target second information queue is equal to the preset time of the multiple payment type configuration.
4. The method of claim 1, wherein the server further configures a subscription message queue, the method further comprising:
obtaining a target notification message of the target payment result message;
storing the target notification message to the subscription message queue and sending the target notification message to the payment device.
5. An asynchronous processing method of a payment result message, which is characterized by being applied to a payment device, wherein the payment device configures a plurality of second message queues, and different second message queues correspond to different payment service types, and the asynchronous processing method comprises the following steps:
receiving a synchronous storage instruction; the synchronous storage instruction is sent by the server when target payment result information is stored in a target first information queue in a plurality of first information queues configured in the server, and the target first information queue is determined according to the target payment service type of the target payment result information;
according to the synchronous storage instruction, synchronously storing target payment result information in target second message queues corresponding to the target first message queues in a plurality of second message queues;
and acquiring the target payment result message from the target second message queue.
6. The method of claim 5, wherein the target payment result message further carries a target deletion condition, the target deletion condition being determined based on a target payment service type of the target payment result message, the method further comprising:
deleting the target payment result message from the target second message queue if the target deletion condition is met, and sending a synchronous deletion instruction to a server; the synchronous deleting instruction is used for synchronously deleting the target payment result message from the target first message queue.
7. The method of claim 5, wherein when the target payment service type is a one-time payment type, the target deletion condition is that the payment device obtains the target payment result message from the target second message queue; when the target payment service type is a multiple payment type, the target deletion condition is that the accumulated times of the target payment result information obtained by the payment equipment from the target second information queue are equal to the preset times of the multiple payment type configuration, or the storage time of the target payment result in the target second information queue is equal to the preset time of the multiple payment type configuration.
8. The method of claim 5, wherein the method further comprises:
receiving a target notification message of the target payment result message; the target notification message is sent by the server when being stored in a subscription message queue of the configuration server;
the obtaining the target payment result message from the target second message queue specifically includes:
and acquiring the target payment result message from the target second message queue according to the target notification message.
9. An asynchronous processing device for payment result messages, applied to a server, said server configuring a plurality of first message queues, different ones of said first message queues corresponding to different payment service types, comprising: an obtaining unit, a determining unit and a first storage unit;
the obtaining unit is used for obtaining a target payment result message;
the determining unit is used for determining a target first message queue corresponding to the target payment service type from a plurality of first message queues according to the target payment service type of the target payment result message;
the storage and transmission unit is used for storing the target payment result message to the target first message queue and transmitting a synchronous storage instruction to the payment equipment; the synchronous storage instruction is used for synchronously storing the target payment result message to a target second message queue which is configured in the payment equipment and corresponds to the target first message queue.
10. An asynchronous processing device for a payment result message, applied to a payment device, wherein the payment device configures a plurality of second message queues, and different second message queues correspond to different payment service types, and the asynchronous processing device comprises: the device comprises a receiving unit, a storage unit and an acquisition unit;
The first receiving unit is used for receiving the synchronous storage instruction; the synchronous storage instruction is sent by the server when target payment result information is stored in a target first information queue in a plurality of first information queues configured in the server, and the target first information queue is determined according to the target payment service type of the target payment result information;
the storage unit is used for synchronously storing target payment result messages in target second message queues corresponding to the target first message queues in a plurality of second message queues according to the synchronous storage instruction;
the obtaining unit is configured to obtain the target payment result message from the target second message queue.
CN202310806994.5A 2023-07-03 2023-07-03 Asynchronous processing method and device for payment result message Pending CN116915723A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310806994.5A CN116915723A (en) 2023-07-03 2023-07-03 Asynchronous processing method and device for payment result message

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310806994.5A CN116915723A (en) 2023-07-03 2023-07-03 Asynchronous processing method and device for payment result message

Publications (1)

Publication Number Publication Date
CN116915723A true CN116915723A (en) 2023-10-20

Family

ID=88359421

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310806994.5A Pending CN116915723A (en) 2023-07-03 2023-07-03 Asynchronous processing method and device for payment result message

Country Status (1)

Country Link
CN (1) CN116915723A (en)

Similar Documents

Publication Publication Date Title
CN109542865B (en) Method, device, system and medium for synchronizing configuration files of distributed cluster system
CN108712332B (en) Communication method, system and device
US20080133337A1 (en) Method, apparatus and computer program for controlling retention of publications
US20100281154A1 (en) Methods and Apparatus for Remote Monitoring
EP1929705B1 (en) Device management method using nodes having additional attribute and device management client thereof
CN110858850A (en) Comprehensive network management method, device and system for rail transit system
US20090177743A1 (en) Device, Method and Computer Program Product for Cluster Based Conferencing
JP2007074724A (en) Method and apparatus for synchronizing epg information between server and client in digital broadcasting network
CN112711635B (en) Method for cross-regional data consistency of distributed Internet of things equipment and service cluster
CN108712457A (en) Back-end server dynamic load method of adjustment and device based on Nginx reverse proxys
CN113391979A (en) Processing method, equipment and system for monitoring data display and storage medium
CN112333249A (en) Business service system and method
CN110851290A (en) Data synchronization method and device, electronic equipment and storage medium
CN110995566A (en) Message data pushing method, system and device
CN114328618A (en) Cache data synchronization method, device, equipment and storage medium
CN112055061A (en) Distributed message processing method and device
CN111212135A (en) Message subscription method, device, system, electronic equipment and storage medium
CN112052227A (en) Data change log processing method and device and electronic equipment
CN111460038A (en) Quasi-real-time data synchronization method and device
CN113329205B (en) Internet of things video data processing system, method and device
CN112838980B (en) Message processing method, system, device, electronic equipment and storage medium
CN107168642B (en) Data storage method and system
CN113965538B (en) Equipment state message processing method, device and storage medium
CN112865927B (en) Message delivery verification method, device, computer equipment and storage medium
CN116915723A (en) Asynchronous processing method and device for payment result message

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination