Transaction processing system and transaction processing method

By introducing message distribution devices and delayed distribution functions in the transaction processing system, the problems of unreliability and resource consumption of timeout transaction processing are solved, and efficient and reliable transaction processing is achieved, which is suitable for scenarios such as large transaction volume or network blockage.

CN119205322APending Publication Date: 2024-12-27NETSUNION CLEARING CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310760927.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-26
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

The prior art cannot guarantee the reliability of the processing when processing timeout transactions, resulting in application failures and increased resource consumption, especially when the transaction volume is large or the network is blocked, it may cause the transaction processing server to be paralyzed.

Method used

By introducing a message distribution device into the transaction processing system, using the delay distribution function, the timeout transaction is delayed to the transaction processing server, and processed according to the delay strategy, avoiding the emergence of a large number of pending transactions in an instant, and reducing computing pressure and resource consumption.

Benefits of technology

It significantly improves the processing reliability and efficiency of time-out transactions, avoids the paralysis of transaction processing servers, ensures that transactions can be processed in a timely manner, and provides users with more reliable services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119205322A_ABST
    Figure CN119205322A_ABST
Patent Text Reader

Abstract

The invention discloses a transaction processing system and a transaction processing method.The transaction processing system comprises a business server, a message distribution device and a transaction processing server, and the message distribution device is in communication connection with the business server and the transaction processing server; the business server is used for taking the processed overtime transaction as an overtime transaction, generating a first delay strategy according to transaction information of the overtime transaction, and sending the first delay strategy and the overtime transaction to the message distribution processing device; the message distribution device is used for sending the timeout transaction to the transaction processing server in a delayed manner according to a delay strategy, and the delay strategy comprises a first delay strategy; and the transaction processing server is used for processing the first overtime transaction meeting the processing condition. According to the method and the device, the computing pressure of the transaction processing server is reduced, the consumption of computing resources is reduced, the reliability of timeout transaction processing is remarkably improved, the transaction can be timely processed, and more reliable and better services are provided for users.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a transaction processing system and a transaction processing method. Background Art

[0002] In the process of processing transactions, processing timeouts may occur due to network or hardware failures. In the prior art, the processing method for timed-out transactions is usually to have the original application process it again, or to call other applications through the network for processing. Both methods have the problem of not being able to guarantee the reliability of processing when the application fails; on this basis, although the reliability of transaction processing can be improved by developing retry mechanisms, this will lead to a sudden increase in the number of network requests received by the application, high processing pressure, and increased resource consumption. Summary of the invention

[0003] The embodiments of the present application provide a transaction processing system and a transaction processing method. By utilizing the delayed distribution function of a message distribution device, a timed-out transaction is delayed and sent to a downstream transaction processing server to process the timed-out transaction. This not only ensures the reliable processing of the timed-out transaction, but also significantly reduces the computing pressure of the transaction processing server.

[0004] In a first aspect, the present application provides a transaction processing system, wherein the transaction processing system comprises a business server, a message distribution device and a transaction processing server, wherein the message distribution device is communicatively connected to the business server and the transaction processing server respectively;

[0005] The business server is used to treat the timed-out transaction as a timed-out transaction, generate a first delay strategy according to the transaction information of the timed-out transaction, and send the first delay strategy together with the timed-out transaction to the message distribution processing device;

[0006] The message distribution device is used to delay sending the timed-out transaction to the transaction processing server according to a delay strategy, wherein the delay strategy includes the first delay strategy;

[0007] The transaction processing server is used to process the first timed-out transaction that meets the processing conditions.

[0008] Optionally, in the above-mentioned transaction processing system, the business server is used to determine a first time duration between the time of receiving the target transaction and the current time. If the first time duration is greater than the maximum processing time limit corresponding to the transaction type of the target transaction, the target transaction is determined to be a timed-out transaction.

[0009] Optionally, in the above-mentioned transaction processing system, the delay strategy includes a second delay strategy;

[0010] The transaction processing server is used to generate the second delay strategy for the second timed-out transaction that does not meet the processing conditions according to the transaction information of the second timed-out transaction; and send the second timed-out transaction and the corresponding second delay strategy to the message distribution device, so that the message distribution device delays sending the second timed-out transaction to the transaction processing server according to the second delay strategy.

[0011] Optionally, in the above-mentioned transaction processing system, the transaction processing server is used to count the total number of delayed transactions to be processed received within a preset time. If the total number is less than a preset traffic threshold, the new delayed transaction will be received as the first timed-out transaction that meets the processing conditions; otherwise, the new delayed transaction will be received as the second timed-out transaction that does not meet the processing conditions.

[0012] Optionally, in the above-mentioned transaction processing system, the delay strategy includes a third delay strategy;

[0013] The transaction processing server is used to generate the third delay strategy for the third timed-out transaction that fails to be processed according to the transaction information of the third timed-out transaction; and send the third timed-out transaction and the third delay strategy to the message distribution device, so that the message distribution device delays sending the timed-out transaction to the transaction processing server according to the third delay strategy.

[0014] Optionally, in the above-mentioned transaction processing system, the message distribution device is used to parse the sending time and the delay duration from the delay strategy, and send the corresponding timed-out transaction to the transaction processing server when the sending time is reached; and, use the delay duration to update the sending time, so that if the corresponding timed-out transaction fails to be sent, the corresponding timed-out transaction will be sent to the transaction processing server when the sending time is reached next time.

[0015] Optionally, in the above-mentioned transaction processing system, the business server is further used to send the callback address of the timed transaction together with the timed transaction to the message distribution processing device;

[0016] The message distribution device is further used to send the callback address of the timed transaction together with the timed transaction delay to the transaction processing server according to the delay strategy;

[0017] The transaction processing server is further used to feed back the processing result of the timed transaction through the callback address.

[0018] In a second aspect, an embodiment of the present application further provides a transaction processing method, wherein the method is executed by a transaction processing server, and the method includes:

[0019] receiving a timeout transaction sent by a message distribution device, wherein the timeout transaction is a transaction that is processed by a business server as a timeout transaction, generating a first delay strategy according to transaction information of the timeout transaction, and sending the first delay strategy together with the timeout transaction to the message distribution processing device, and the message distribution processing device sends the timeout transaction to the transaction processing server according to the delay strategy, wherein the delay strategy includes the first delay strategy;

[0020] A first timed-out transaction that meets a processing condition is determined, and the first timed-out transaction is processed.

[0021] Optionally, in the above transaction processing method, the delay strategy includes a second delay strategy; the method further includes:

[0022] Determine a second timed-out transaction that does not satisfy the processing condition;

[0023] generating the second delay strategy according to the transaction information of the second timeout transaction;

[0024] The second timeout transaction and the corresponding second delay strategy are sent to the message distribution device, so that the message distribution device delays sending the second timeout transaction to the transaction processing server according to the second delay strategy.

[0025] Optionally, in the above transaction processing method, the delay strategy includes a third delay strategy; the method further includes:

[0026] Determine the third timeout transaction that failed to process;

[0027] generating the third delay strategy according to the transaction information of the third timeout transaction;

[0028] The third timeout transaction and the third delay strategy are sent to the message distribution device, so that the message distribution device delays sending the timeout transaction to the transaction processing server according to the third delay strategy.

[0029] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a processor; and a memory arranged to store computer executable instructions, wherein when the executable instructions are executed, the processor executes any of the above-mentioned transaction processing methods.

[0030] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores one or more programs, and when the one or more programs are executed by an electronic device including multiple applications, the electronic device executes any of the above-mentioned transaction processing methods.

[0031] At least one of the above technical solutions adopted in the embodiments of the present application can achieve the following beneficial effects:

[0032] The present application provides a transaction processing system, which includes a business server, a message distribution device and a transaction processing server, wherein the message distribution device is respectively connected to the business server and the transaction processing server in communication; when the business server processes a transaction request, it regards the transaction that has been processed for a timeout as a timeout transaction, generates a first delay strategy based on the transaction information of the timeout transaction, and sends the first delay strategy together with the transaction to the message distribution processing device; the message distribution device is used to send the timeout transaction to the transaction processing server with a delay according to the delay strategy, and the delay strategy includes the first delay strategy; the transaction processing server is used to process the first timeout transaction that meets the processing conditions. The present application sets a message distribution device, and according to the timeout transaction sent by the business server and the corresponding delay strategy, the timeout transaction is delayed and distributed to the transaction processing server, and the transaction processing server processes the timeout transaction when it determines that the timeout transaction meets the processing conditions. In the present application, the message distribution device delays the sending of timed transactions, so that the downstream transaction processing server will not suddenly face a large number of timed transactions to be processed, thereby reducing the computing pressure of the transaction processing server, reducing the consumption of computing resources, and greatly reducing the possibility of the transaction processing server being paralyzed due to too many messages, so that timed transactions can be processed in an orderly manner, significantly improving the reliability of timed transaction processing, ensuring that transactions can be processed in a timely manner, and providing users with more reliable and better services. It is especially suitable for scenarios with excessive transaction volume, such as online shopping mall promotions. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0034] Figure 1 A schematic diagram showing the structure of a transaction processing system according to an embodiment of the present application is shown;

[0035] Figure 2 A schematic diagram showing a flow chart of a transaction processing method according to an embodiment of the present application;

[0036] Figure 3 A schematic diagram showing a flow chart of a transaction processing method according to another embodiment of the present application;

[0037] Figure 4 A schematic diagram showing the structure of a transaction processing device according to an embodiment of the present application is shown;

[0038] Figure 5This is a schematic diagram of the structure of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION

[0039] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.

[0040] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.

[0041] In the prior art, the processing of timed transactions is usually to use the original transaction processing application to process the timed transactions again, or to process the timed transactions by calling external applications. Since timed transactions are usually caused by too many transactions, network congestion, hardware damage, etc., the original transaction processing applications or external applications still have the problem of being unable to handle timed transactions in a timely, effective, and reliable manner due to the above reasons. Although some retry mechanisms have emerged in the prior art in order to effectively handle timed transactions, this may cause the application to receive a large number of network requests instantly, resulting in network congestion or even paralysis. The transaction referred to in this application can be transaction data corresponding to the exchange of goods or services generated in the business scenario, such as transaction amount, transaction serial number, etc., or it can be a transaction processing task corresponding to the transaction data.

[0042] The present application provides a transaction processing system and a transaction processing method, which can effectively solve the above problems. The transaction processing method can be implemented by the transaction processing system, for example, Figure 1 Two structural schematic diagrams of a transaction processing system according to an embodiment of the present application are shown. Figure 1 It can be seen that Figure 1 FIG. 1 shows a schematic diagram of a transaction processing system according to an embodiment of the present application. The system 100 includes a business server 110, a message distribution device 120 and a transaction processing server 130. The message distribution device 120 is respectively connected to the business server 110 and the transaction processing server 130 for communication. A transaction processing device 400 ( Figure 4 ).exist Figure 1 In a, in some embodiments of the present application, the business server 110 may have the function of processing transactions in real time, that is, the business server can be used to process transactions in real time and can also be used to distribute timed transactions.

[0043] For example, Figure 1 b shows another structural schematic diagram of a transaction processing system according to an embodiment of the present application. Figure 1 As can be seen from FIG. 1 , the system 100 includes a business server 110, a message distribution device 120 and a transaction processing server 130. The message distribution device 120 is respectively connected to the business server 110 and the transaction processing server 130 for communication. The transaction processing server 130 is provided with a transaction processing device 400 ( Figure 4 ); The business server 100 can also be connected to a real-time transaction processing server 200 that processes transactions in real time. That is to say, under this structure, the business server 110 does not have the function of processing transactions in real time, but is mainly responsible for distributing transactions to the real-time transaction processing server 200.

[0044] It should be noted that this application does not limit the specific form of the transaction processing system. Figure 1 The two forms shown are only for exemplary purposes, and any form that can implement the present application will suffice.

[0045] Whether Figure 1 a and Figure 1 The structure shown in FIG. 1b can be roughly described as follows when processing a transaction: First, the business server 110 determines whether a transaction is a timed transaction. If so, a first delay strategy is generated according to the transaction information of the timed transaction, and the first delay strategy is sent together with the timed transaction to the message distribution device 120; after receiving the timed transaction and the first delay strategy, the message distribution device 120 sends the timed transaction to the transaction processing server 130 according to the first delay strategy; after receiving the timed transaction sent by the message distribution device 120, the transaction processing server 130 determines whether the timed transaction meets the processing conditions, and if so, processes it. In order to distinguish it from the timed transactions processed in other subsequent scenarios, the transaction processed in this scenario is called the first timed transaction.

[0046] The following is a detailed description of the present application from the perspective of the transaction processing server 130. Figure 2 A flow chart of a transaction processing method according to an embodiment of the present application is shown. The method may be executed by the transaction processing server 130 described above. The method at least includes steps S210 to S230:

[0047] Step S210: receiving a timeout transaction sent by a message distribution device, wherein the timeout transaction is a transaction that is processed by a business server as a timeout transaction, generating a first delay strategy according to the transaction information of the timeout transaction, and sending the first delay strategy together with the timeout transaction to the message distribution processing device, and the message distribution processing device sends it to the transaction processing server after delay according to the delay strategy, wherein the delay strategy includes the first delay strategy.

[0048] Please refer to Figure 1 There are two ways to set up a business server: Figure 1 As shown in a, in some embodiments of the present application, the business server 110 may have the same function as a transaction processing server that processes transactions in real time, that is, the business server may be used to process transactions in real time. In addition, the business server 110 may also be used to distribute timed transactions.

[0049] In another embodiment of the present application, Figure 1 As shown in b, the business server 110 can be a component of a real-time transaction processing server 200 connected to process transactions in real time. It is responsible for distributing transactions to the real-time transaction processing server 200 and monitoring the operating status of the real-time transaction processing server 200. If it is detected that the real-time transaction processing server 200 has crashed, transaction tasks will not be allocated to the transaction processing server. In addition, transactions that have been allocated to the transaction processing server before the real-time transaction processing server 200 crashed but have not been processed, or transactions that have timed out in processing by the transaction processing server, can be detected. These transactions can be introduced into the transaction processing system 100 of the present application as timed-out transactions.

[0050] based on Figure 1 When the timeout transaction system shown in a is implemented in this application, the approximate processing flow of a transaction can be briefly described as follows: a transaction arrives at the business server 110 for processing. If the transaction is not processed in time and is determined by the business server 110 as a timeout transaction, a first delay strategy is generated according to the transaction information of the timeout transaction, and the timeout transaction is sent together with the first delay strategy corresponding to the timeout transaction to the message distribution device 120. After receiving the timeout transaction and the first delay strategy, the message distribution device 120 parses the first delay strategy to obtain the sending time node of the timeout transaction, and sends the timeout transaction at the parsed sending time node to the transaction processing server 130, and the transaction processing server 130 further processes the timeout transaction.

[0051] based on Figure 1When the timeout transaction system shown in b implements the present application, the approximate processing flow of a transaction can be briefly described as follows: a transaction first arrives at the business server 110, and the business server 110 distributes the transaction to the real-time transaction processing server 200, which processes it. If the transaction is not processed in time and is determined to be a timeout transaction by the real-time transaction processing server 200 or the business server 110, the business server 110 generates a first delay strategy based on the transaction information of the timeout transaction, and sends the timeout transaction together with the first delay strategy to the message distribution device 120. After receiving the timeout transaction and the first delay strategy, the message distribution device 120 parses the first delay strategy to obtain the sending time node of the timeout transaction, and sends the timeout transaction to the transaction processing server 130 at the parsed sending time node. The transaction processing server 130 further processes the timeout transaction.

[0052] It should be noted that the transaction processing server 130 is a component specially configured to process timed transactions, and its processing logic for timed transactions is consistent with the logic of real-time processing of transactions by the business server 110 or the transaction processing server 200.

[0053] In some embodiments of the present application, based on Figure 1 When the timeout transaction system shown in a implements this application, the identification of the timeout transaction is undertaken by the business server 110. For example, when the network is severely congested, if a transaction is not processed in time when it reaches the business server 110, the business server 110 can confirm whether it has timed out. If it has timed out, it will enter the processing flow of this application. In some embodiments of this application, the specific identification method can be, but is not limited to: determining the first time length from the time of receiving the target transaction to the current time, if the first time length is greater than the maximum processing time limit corresponding to the transaction type of the target transaction, then determining that the target transaction is a timeout transaction. That is, determining the transaction type of a transaction; reading the maximum processing time limit of this type of transaction according to the determined transaction type; determining the first time length from the time of receiving the transaction to the current time, if the first time length is greater than the maximum processing time limit, then determining that the transaction is a timeout transaction.

[0054] based on Figure 1 When the timeout transaction system shown in a implements this application, if it is due to a hardware failure in the business server 110, you can wait for the business server 110 to return to normal and then process each transaction again. If it is found that the transaction has timed out, the timed-out transaction will be introduced into the processing flow of this application.

[0055] In other embodiments of the present application, based on Figure 1When the timeout transaction system shown in b is implemented in this application, the identification of timeout transactions can be undertaken by the business server 110 or by the real-time transaction processing server 200. For example, when the network is severely congested, if the real-time transaction processing server 200 determines that a transaction has expired, it can return the timeout transaction to the business server 110, so that the business server 110 introduces it into the processing flow of this application. If the real-time transaction processing server 200 has a hardware failure, since the business server 110 is responsible for supervising the processing of transactions by the real-time transaction processing server 200, the business server 110 can discover and introduce the timeout transactions generated during the failure of the real-time transaction processing server 200 into the processing flow of this application.

[0056] In some embodiments of the present application, the specific manifestation of the message distribution device 120 can be a message queue with a delayed sending function. The message entry and exit principle of the message queue in the prior art is usually based on first-in-first-out and last-in-last-out. This type of queue will only distribute messages according to the order in which the messages enter the queue; there are also queues that provide asynchronous processing principles, such as kafka message queues. This queue can also provide a "delay" service, but the mechanism of this "delay" is different from the present application. Specifically, when the kafka message queue sends a message to a downstream application, the downstream application may not receive it and return the message to the kafka message queue. The kafka message queue will store the message in the queue again and continue to send it. If the downstream application has always refused to receive it, the kafka message queue will keep storing the message in the queue and send it repeatedly until the downstream application receives it. Although this type of queue can also allow downstream applications to postpone processing of messages when they do not want to process the messages immediately, and allow downstream applications to put the messages into the queue again and receive them when they want to process them, this is based on the fact that the Kafka message queue continuously sends messages and downstream applications continuously reject them, which puts a heavy burden on both the message queue and the downstream applications.

[0057] Different from the prior art, the message queue in the message distribution device 120 of the present application has a delay function, and the principle of sending messages is based on the delay strategy. In other embodiments of the present application, the message distribution device 130 is used to parse the sending time and the delay duration from the delay strategy, and when the sending time is reached, the corresponding timed-out transaction is sent to the transaction processing server; and, the sending time is updated using the delay duration, so that when the corresponding timed-out transaction fails to be sent, the corresponding timed-out transaction is sent to the transaction processing server when the sending time is reached next time.

[0058] For example, if the first delay strategy includes a delay duration of 5 seconds, and the message distribution device receives a delayed transaction at 1:00:00, the message distribution device does not immediately send out the delayed transaction, but first determines that the sending time of the delayed transaction should be 1:00:05 according to the first delay strategy. Then, when the time reaches 1:00:05, the delayed transaction is sent.

[0059] For example, suppose that the first delay strategy contains a sending time and a delay duration, the sending time is 1:00:00, and the delay duration is 5s; the message distribution device sends the delayed transaction at 1:00:00. This sending may not be successful, so the delay duration can be used to update the sending time. The updated sending time is 1:00:05. When the time reaches 1:00:05, the message distribution device will send the delayed transaction again to ensure the successful sending of the delayed transaction.

[0060] More specifically, based on Figure 1 The timeout transaction system shown in a implements the present application. When the business server 110 has the function of processing transactions in real time, a timeout transaction is a transaction in which the business server 110 processes the transaction in time. For example, if the maximum processing time limit for a transaction is 10s, if the business server fails to process the transaction successfully within 10s from the time the transaction is received, the transaction is a timeout transaction.

[0061] After determining that a transaction is a timed transaction, the business server 110 generates a first delay strategy according to the transaction information of the transaction, and integrates the first delay strategy and the timed transaction, and sends them together to the message distribution device 120 .

[0062] In some embodiments of the present application, since different transaction types have different requirements for real-time performance, the first delay strategy can be generated according to the transaction type of the transaction. Specifically, the transaction type of the timed transaction can be determined according to the transaction information of the timed transaction; the first delay strategy can be determined according to the transaction type, wherein the first delay strategy includes the first sending time and the first delay duration.

[0063] If the current time is 1:00:00, the business server 110 determines that a transaction processing timeout has occurred. At this time, the business server 110 determines the transaction type based on the specific information of the transaction, such as the transaction creation time, transaction content, and identity information of both parties to the transaction, such as determining that the transaction type is a food retail transaction; since food retail transactions have high real-time requirements, the time when the timeout transaction is sent to the downstream transaction processing server 130 can be closer to the current time, and the first delay time can also be set to be relatively short. For example, the first sending time can be set to be 10s plus the current time, that is, 1:00:10, and the first delay time is 30s.

[0064] When the message distribution device 120 sends the timeout transaction according to the first delay strategy, the timeout transaction is sent out at 1:00:10. In order to prevent the timeout transaction from failing to be sent, the first delay duration can be used to update the sending time. If the timeout transaction fails to be sent, the message can be sent again according to the updated first sending time. That is, if the timeout transaction fails to be sent at 1:00:10, the timeout transaction can be sent again at 1:00:40.

[0065] The present application does not limit the specific content of the first delay strategy. For example, in the first delay strategy, the first sending time may not be specified, and only the first delay duration may be included. When the message distribution device 120 sends the timeout transaction according to the first delay strategy, the first sending time may be determined according to the current time and the first delay duration. For example, if the current time is 1:00:00, and the message distribution device 120 receives the timeout transaction, the first delay duration is parsed from the first delay strategy to be 5s, and the first sending time is determined to be 1:00:05 according to the current time, and when the time reaches 1:00:05, the timeout transaction is sent out.

[0066] In some embodiments of the present application, the first delay strategy can also be preset in advance according to common transaction types and stored in a specific area of ​​the business server. Each time a timed transaction is sent, the corresponding first delay strategy can be read in the specific area according to the transaction type of the timed transaction. The first delay strategy is not the same for all timed transactions, but different timed transactions can correspond to different first delay strategies. For example, one transaction involves a transaction in which a user buys breakfast, and the other transaction involves a public-to-public transfer transaction. Both transactions have timed out, but the first transaction requires strong real-time performance, and the delay duration in its first delay strategy can be set to be relatively short, such as 5s; while the second transaction does not require strong real-time performance, and the delay duration in its first delay strategy can be set to be relatively long, such as 1h.

[0067] The large number of timed transactions is usually caused by hardware failure or severe network congestion. The above-mentioned delayed sending method can not only ensure that the timed transactions are processed within a reasonable time limit, but also prevent a large number of timed transactions from instantly pouring into the downstream transaction processing server 130 at the same time, thereby avoiding the problem that the transaction processing server 130 receives a large number of timed transactions in a short period of time and has difficulty in processing or even paralysis, thereby significantly improving the reliability of timed transaction processing.

[0068] Step S210: Determine a first timed-out transaction that meets a processing condition, and process the first timed-out transaction.

[0069] After receiving the timed-out transaction, the transaction processing server 130 determines whether the timed-out transaction satisfies the processing conditions, records the timed-out transaction that satisfies the processing conditions as the first timed-out transaction, and processes the first timed-out transaction.

[0070] The processing conditions may be set according to the operating status of the transaction processing server 130. For example, in some embodiments of the present application, flow control rules may be set to determine whether a timed transaction meets the processing conditions according to the flow control rules to ensure timely processing of the timed transaction.

[0071] In some embodiments of the present application, the transaction processing server 130 counts the total number of delayed transactions to be processed received within a preset time. If the total number is less than a preset traffic threshold, the new delayed transaction will be received as the first timed-out transaction that meets the processing conditions; otherwise, the new delayed transaction will be received as the second timed-out transaction that does not meet the processing conditions.

[0072] Since the reasons for timeout transactions are usually due to network congestion, excessive transaction volume, hardware failure, etc., in this scenario, a large number of timeout transactions will be generated in a short period of time. In order to ensure the normal operation of the transaction processing server 130, a preset traffic threshold can be set to control the number of timeout transactions that the transaction processing server 130 needs to process within a period of time. Specifically, the transaction processing server 130 can count the total number of delayed transactions to be processed received within a preset time, such as within 5 minutes. If the total number is less than the preset traffic threshold, the newly received delayed transaction will be regarded as the first timeout transaction that meets the processing conditions and will be processed directly; otherwise, the newly received delayed transaction will be regarded as the second timeout transaction that does not meet the processing conditions and will be temporarily shelved.

[0073] from Figure 2It can be seen that the present application provides a transaction processing system, which includes a business server, a message distribution device and a transaction processing server, the message distribution device is respectively connected to the business server and the transaction processing server in communication; when the business server processes the transaction request, it will treat the transaction that has been processed for timeout as a timeout transaction, generate a first delay strategy based on the transaction information of the timeout transaction, and send the first delay strategy together with the transaction to the message distribution processing device; the message distribution device is used to send the timeout transaction to the transaction processing server with a delay according to the delay strategy, and the delay strategy includes the first delay strategy; the transaction processing server is used to process the first timeout transaction that meets the processing conditions. The present application sets up a message distribution device, and according to the timeout transaction sent by the business server and the corresponding delay strategy, the timeout transaction is delayed and distributed to the transaction processing server. When the transaction processing server determines that the timeout transaction meets the processing conditions, it processes the timeout transaction. In the present application, the message distribution device delays the sending of timed transactions, so that the downstream transaction processing server will not suddenly face a large number of timed transactions to be processed, thereby reducing the computing pressure of the transaction processing server, reducing the consumption of computing resources, and greatly reducing the possibility of the transaction processing server being paralyzed due to too many messages, so that timed transactions can be processed in an orderly manner, significantly improving the reliability of timed transaction processing, ensuring that transactions can be processed in a timely manner, and providing users with more reliable and better services. It is especially suitable for scenarios with excessive transaction volume, such as online shopping mall promotions.

[0074] In some embodiments of the present application, the delay strategy includes a second delay strategy; the method also includes: determining a second timeout transaction that does not meet the processing conditions; generating the second delay strategy based on the transaction information of the second timeout transaction; sending the second timeout transaction and the corresponding second delay strategy to the message distribution device, so that the message distribution device delays sending the second timeout transaction to the transaction processing server according to the second delay strategy.

[0075] In some embodiments of the present application, the processing conditions are set mainly to avoid the transaction processing server from having to process a large number of pending timeout transactions in a short period of time. Therefore, if a timeout transaction does not meet the processing conditions, the timeout transaction is not directly abandoned. Figure 1 Taking the implementation of the timeout transaction system shown in a as an example of the present application, the transaction processing server 130 can generate a second delay strategy based on the transaction information of the timeout transaction, and return the timeout transaction and the second delay strategy to the message distribution device 120. The message distribution device 120 can delay the timeout transaction again according to the second delay strategy and send it to the transaction processing server 130, so that the transaction processing server 130 processes the timeout transaction again.

[0076] In some embodiments of the present application, the method for generating the second delay strategy may be the same as or different from the method for generating the first delay strategy. Since both are generated for the same timeout transaction, it is recommended to use the same delay strategy. Like the first delay strategy, the second delay strategy can also be preset in advance according to common transaction types and stored in a specific area of ​​the transaction processing server 130. Each time a timeout transaction is sent, the corresponding second delay strategy can be read in the specific area according to the transaction type of the timeout transaction. It should be distinguished that the first delay strategy is generated by the business server 110, and the second delay strategy is generated by the transaction processing server 130.

[0077] In some embodiments of the present application, the second delay strategy includes a second sending time and a second delay duration. When the message distribution device 120 sends a timed transaction according to the first delay strategy, the message distribution device 110 may delay sending the timed transaction to the transaction processing server 130 at the second sending time when the timed transaction is delayed again according to the second delay strategy; after the timed transaction is sent, the second sending time is updated according to the second delay duration.

[0078] In some embodiments of the present application, the delay strategy includes a third delay strategy; the method further includes: determining a third timeout transaction that failed to be processed; generating the third delay strategy according to the transaction information of the third timeout transaction; sending the third timeout transaction and the third delay strategy to the message distribution device, so that the message distribution device delays sending the timeout transaction to the transaction processing server according to the third delay strategy. In some embodiments of the present application, there is a situation where the transaction processing server 130 fails to process the timeout transaction, which may also be caused by the transaction processing server 130 being too busy. Therefore, the processing of the timeout transaction is still not abandoned. The transaction processing server 130 can generate a third delay strategy according to the transaction information of the timeout transaction; sending the timeout transaction and the third delay strategy to the message distribution device 120, and the message distribution device 120 can delay sending the timeout transaction to the transaction processing server 130 again according to the third delay strategy, so that the transaction processing server 130 processes the timeout transaction again. In this way, the timeout transaction can be repeatedly processed until it is successfully processed. Of course, the same timeout transaction cannot be processed indefinitely. There may be many reasons why the timeout transaction cannot be successfully processed. A processing number threshold can be preset. For example, if a transaction cannot be successfully processed after being processed 5 times, it is determined that the timeout transaction processing has failed.

[0079] In some embodiments of the present application, the method for generating the third delay strategy may be the same as or different from the method for generating the first delay strategy or the second delay strategy. Since they are all generated for the same timeout transaction, it is recommended to use the same delay strategy. Like the first or second delay strategy, the third delay strategy can also be preset in advance according to common transaction types and stored in a specific area of ​​the transaction processing server 130. Each time a timeout transaction is sent, the corresponding third delay strategy can be read in the specific area according to the transaction type of the timeout transaction. It should be distinguished that the first delay strategy is generated by the business server 110, and the third delay strategy is generated by the transaction processing server 130.

[0080] In some embodiments of the present application, the third delay strategy includes a third sending time and a third delay duration. When the message distribution device 120 sends a timed transaction according to the first delay strategy, the message distribution device 110 may delay sending the timed transaction to the transaction processing server 130 at the third sending time when the timed transaction is delayed again according to the third delay strategy; after the timed transaction is sent, the third sending time is updated according to the third delay duration.

[0081] In some embodiments of the present application, after the transaction processing server 130 completes the timeout transaction processing, the business server 110 may be notified through the callback address whether the timeout transaction is successfully processed. The callback address may be sent to the transaction processing server 130 together with the timeout transaction through the message distribution device 120. After determining that the timeout transaction processing is successful, the transaction processing server 130 notifies the business server 110 of the success of the timeout transaction processing through the callback address corresponding to the timeout transaction; of course, if the timeout transaction processing fails, the business server 110 may also be notified. It should be noted that the specific processing result of the timeout transaction can be directly returned to the business end without having to be returned to the business server 110.

[0082] Figure 3 A flow chart of a transaction processing method according to another embodiment of the present application is shown, as can be seen from Figure 3:

[0083] After determining that a transaction A is a timed transaction, the business server determines the transaction type of transaction A according to the transaction information of transaction A, and generates a first delay strategy according to the transaction type of A. The business server integrates transaction A and the first delay strategy and sends them to the message distribution device.

[0084] Determine whether the timeout transaction triggers the first delay strategy. If not, continue to wait until the timeout transaction triggers the first delay strategy. If triggered, send transaction A to the timeout transaction business processing server.

[0085] After receiving transaction A, the transaction processing server determines whether transaction A triggers the flow control rule. If not, it extracts the transaction information and callback address of transaction A and processes transaction A according to the transaction information.

[0086] If transaction A triggers the flow control rule, the transaction information of transaction A is extracted, a second delay strategy is generated according to the transaction information, and transaction A and the second delay strategy are returned to the message distribution device.

[0087] After receiving transaction A, the message distribution processing device determines whether the timeout transaction A triggers the second delay strategy. If not, it continues to wait until the timeout transaction A triggers the second delay strategy. If triggered, transaction A is sent to the timeout transaction service processing server for reprocessing.

[0088] After receiving transaction A, the transaction processing server determines whether transaction A triggers the flow control rule. If the flow control rule is triggered, the transaction processing server can return the timed-out transaction to the message distribution device again.

[0089] If transaction A does not trigger the flow control rule, the transaction information of transaction A and the callback address of transaction A are extracted, and transaction A is processed according to the transaction information. After processing, it is determined whether transaction A is successfully processed. If successful, the business server is notified that transaction A is successfully processed according to the callback address of A; if unsuccessful, the transaction information of transaction A is extracted, the third delay strategy is generated according to the transaction information, and transaction A and the third delay strategy are returned to the message distribution device.

[0090] After receiving transaction A, the message distribution processing device determines whether the timeout transaction A triggers the third delay strategy. If not, it continues to wait until the timeout transaction A triggers the third delay strategy. If triggered, the transaction A is sent to the timeout transaction service processing server for reprocessing.

[0091] Figure 4 A schematic diagram of the structure of a transaction processing device according to an embodiment of the present application is shown, and the device is deployed on a transaction processing server 130 ( Figure 1 ), the device 400 comprises:

[0092] The receiving unit 410 is used to receive a timeout transaction sent by the message distribution device, wherein the timeout transaction is a transaction that is processed by the business server as a timeout transaction, and a first delay strategy is generated according to the transaction information of the timeout transaction, and the first delay strategy is sent together with the timeout transaction to the message distribution processing device, and the message distribution processing device sends the timeout transaction to the transaction processing server according to the delay strategy, wherein the delay strategy includes the first delay strategy;

[0093] The processing unit 420 is used to determine a first timed-out transaction that meets the processing condition and process the first timed-out transaction.

[0094] In some embodiments of the present application, in the above-mentioned transaction processing device, the delay strategy includes a second delay strategy; the processing unit 420 is also used to determine a second timeout transaction that does not meet the processing conditions; generate the second delay strategy based on the transaction information of the second timeout transaction; send the second timeout transaction and the corresponding second delay policy to the message distribution device, so that the message distribution device delays the sending of the second timeout transaction to the transaction processing server according to the second delay policy.

[0095] In some embodiments of the present application, in the above-mentioned transaction processing device, the processing unit 420 is used to count the total number of delayed transactions to be processed received within a preset time. If the total number is less than a preset traffic threshold, the new delayed transaction will be received as the first timed-out transaction that meets the processing conditions; otherwise, the new delayed transaction will be received as the second timed-out transaction that does not meet the processing conditions.

[0096] In some embodiments of the present application, in the above-mentioned transaction processing device, the delay strategy includes a third delay strategy; the processing unit 420 is also used to determine the third timeout transaction that failed to be processed; generate the third delay strategy based on the transaction information of the third timeout transaction; send the third timeout transaction and the third delay policy to the message distribution device, so that the message distribution device delays the sending of the timeout transaction to the transaction processing server according to the third delay strategy.

[0097] It can be understood that the above-mentioned transaction processing device can implement the various steps of the transaction processing method performed by the transaction processing server provided in the aforementioned embodiment. The relevant explanations about the transaction processing method are applicable to the transaction processing device and will not be repeated here.

[0098] Figure 5 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. Figure 5 At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and a memory. The memory may include a memory, such as a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage. Of course, the electronic device may also include hardware required for other services.

[0099] The processor, network interface and memory can be interconnected through an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0100] The memory is used to store the program. Specifically, the program may include a program code, and the program code includes a computer operation instruction. The memory may include a memory and a non-volatile memory, and provides instructions and data to the processor.

[0101] The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming a transaction processing device at the logical level. The processor executes the program stored in the memory and is specifically used to perform the following operations:

[0102] receiving a timeout transaction sent by a message distribution device, wherein the timeout transaction is a transaction that is processed by a business server as a timeout transaction, generating a first delay strategy according to transaction information of the timeout transaction, and sending the first delay strategy together with the timeout transaction to the message distribution processing device, and the message distribution processing device sends the timeout transaction to the transaction processing server according to the delay strategy, wherein the delay strategy includes the first delay strategy;

[0103] A first timed-out transaction that meets a processing condition is determined, and the first timed-out transaction is processed.

[0104] The above application Figure 4The method performed by the transaction processing device disclosed in the illustrated embodiment can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor or an instruction in the form of software. The above processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module can be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.

[0105] The electronic device may also perform Figure 4 The method executed by the transaction processing device in Figure 4 The functions of the illustrated embodiment will not be described in detail in the embodiments of the present application.

[0106] The present application also provides a computer-readable storage medium, which stores one or more programs, wherein the one or more programs include instructions, which, when executed by an electronic device including multiple application programs, enable the electronic device to execute Figure 4 The method executed by the transaction processing device in the illustrated embodiment is specifically used to execute:

[0107] receiving a timeout transaction sent by a message distribution device, wherein the timeout transaction is a transaction that is processed by a business server as a timeout transaction, generating a first delay strategy according to transaction information of the timeout transaction, and sending the first delay strategy together with the timeout transaction to the message distribution processing device, and the message distribution processing device sends the timeout transaction to the transaction processing server according to the delay strategy, wherein the delay strategy includes the first delay strategy;

[0108] A first timed-out transaction that meets a processing condition is determined, and the first timed-out transaction is processed.

[0109] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0110] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0111] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0112] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0113] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0114] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0115] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0116] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0117] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0118] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims

1. A transaction processing system, wherein: The transaction processing system comprises a business server, a message distribution device and a transaction processing server, wherein the message distribution device is respectively connected to the business server and the transaction processing server for communication; The business server is used to treat the timed-out transaction as a timed-out transaction, generate a first delay strategy according to the transaction information of the timed-out transaction, and send the first delay strategy together with the timed-out transaction to the message distribution processing device; The message distribution device is used to delay sending the timed-out transaction to the transaction processing server according to a delay strategy, wherein the delay strategy includes the first delay strategy; The transaction processing server is used to process the first timed-out transaction that meets the processing conditions.

2. The transaction processing system according to claim 1, wherein: The business server is used to determine a first time interval between the time of receiving the target transaction and the current time, and if the first time interval is greater than a maximum processing time limit corresponding to the transaction type of the target transaction, determine that the target transaction is a timed-out transaction.

3. The transaction processing system according to claim 1, wherein: The delay strategy includes a second delay strategy; The transaction processing server is configured to generate the second delay strategy for the second timed-out transaction that does not meet the processing condition according to the transaction information of the second timed-out transaction; The second timeout transaction and the corresponding second delay strategy are sent to the message distribution device, so that the message distribution device delays sending the second timeout transaction to the transaction processing server according to the second delay strategy.

4. The transaction processing system according to claim 1, wherein: The transaction processing server is used to count the total number of delayed transactions to be processed received within a preset time. If the total number is less than a preset traffic threshold, the new delayed transaction will be received as the first timed-out transaction that meets the processing conditions; otherwise, the new delayed transaction will be received as the second timed-out transaction that does not meet the processing conditions.

5. The transaction processing system according to claim 1, wherein: The delay strategy includes a third delay strategy; The transaction processing server is used to generate the third delay strategy for the third timeout transaction that failed to be processed according to the transaction information of the third timeout transaction; The third timeout transaction and the third delay strategy are sent to the message distribution device, so that the message distribution device delays sending the timeout transaction to the transaction processing server according to the third delay strategy.

6. The transaction processing system according to claim 1, wherein: The message distribution device is used to parse the sending time and the delay duration from the delay strategy, and send the corresponding timed-out transaction to the transaction processing server when the sending time is reached; and update the sending time using the delay duration, so that if the corresponding timed-out transaction fails to be sent, the corresponding timed-out transaction will be sent to the transaction processing server when the sending time is reached next time.

7. The transaction processing system according to claim 1, wherein: The business server is further used to send the callback address of the timed transaction together with the timed transaction to the message distribution processing device; The message distribution device is further used to send the callback address of the timed transaction together with the timed transaction delay to the transaction processing server according to the delay strategy; The transaction processing server is further configured to feed back a processing result of the timed transaction through the callback address.

8. A transaction processing method, wherein: The method is executed by a transaction processing server, and comprises: receiving a timeout transaction sent by a message distribution device, wherein the timeout transaction is a transaction that is processed by a business server as a timeout transaction, generating a first delay strategy according to transaction information of the timeout transaction, and sending the first delay strategy together with the timeout transaction to the message distribution processing device, and the message distribution processing device sends the timeout transaction to the transaction processing server according to the delay strategy, wherein the delay strategy includes the first delay strategy; A first timed-out transaction that meets a processing condition is determined, and the first timed-out transaction is processed.

9. The transaction processing method according to claim 8, wherein: The delay strategy includes a second delay strategy; and the method further includes: Determine a second timed-out transaction that does not satisfy the processing condition; generating the second delay strategy according to the transaction information of the second timeout transaction; The second timeout transaction and the corresponding second delay strategy are sent to the message distribution device, so that the message distribution device delays sending the second timeout transaction to the transaction processing server according to the second delay strategy.

10. The transaction processing method according to claim 1, wherein: The delay strategy includes a third delay strategy; and the method further includes: Determine the third timeout transaction that failed to process; generating the third delay strategy according to the transaction information of the third timeout transaction; The third timeout transaction and the third delay strategy are sent to the message distribution device, so that the message distribution device delays sending the timeout transaction to the transaction processing server according to the third delay strategy.