Method and apparatus for managing transaction channel

By monitoring notification messages and statistical request data from transaction channels, the status of transaction channels can be dynamically managed, resolving issues such as payment failures and long waiting times caused by abnormal transaction channels, thereby improving the stability of the transaction system and the user experience.

CN113971608BActive Publication Date: 2025-12-09ZHEJIANG VIPSHOP PAYMENT SERVICES CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111247911.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-26
Publication Date
2025-12-09
Estimated Expiration
2041-10-26

AI Technical Summary

Technical Problem

In existing transaction systems, if a transaction channel is abnormal, continuing to initiate a transaction request may result in payment failure or long waiting times, leading to a poor user experience. How can we effectively manage transaction channels and promptly detect abnormal statuses?

Method used

By listening to notification messages from transaction channels, collecting transaction request data, and judging the channel status based on preset conditions, the circuit breaker can be opened or closed in a timely manner to achieve dynamic management of the channel status, including switching between normal status, semi-open/closed status, and circuit breaker status.

Benefits of technology

It improved the stability of the transaction system and the user experience, reduced the number of abnormal orders, shortened the transaction request processing time, reduced the pressure on other channels, and increased enterprise profits.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113971608B_ABST
    Figure CN113971608B_ABST
Patent Text Reader

Abstract

The application relates to a transaction channel management method and device, which comprises the following steps: listening to a notification message generated by a transaction channel after the transaction channel receives a transaction request sent by a transaction channel invoker; according to the notification message and a current channel state of the transaction channel, transaction request data of the transaction channel is counted; it is judged whether the transaction request data satisfies a preset condition of changing the current channel state; if the preset condition is satisfied, the current channel state is changed to a preset state corresponding to the preset condition; through the change of the current channel state, when the transaction channel is faulty, the subsequent transaction request can be prevented from passing through the transaction channel again to cause a long transaction request processing time, and when the transaction channel is normal, the pressure on other transaction channels can be avoided.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of Internet, in particular to a transaction channel management method and device. BACKGROUND

[0002] With the rapid development of the Internet field, Internet shopping has become a common shopping way for people. In Internet shopping, a user places an order on a shopping website and then makes payment in a transaction system.

[0003] At present, most transaction systems are connected to multiple transaction channels. If a transaction request is initiated continuously when an abnormality occurs in a transaction channel, payment failure or long waiting time may occur, and the user experience is poor. Therefore, how to manage transaction channels to timely find transaction channels with abnormal states is a problem to be solved. SUMMARY

[0004] To solve the above technical problems, the present application provides a transaction channel management method and device, and the specific solutions are as follows:

[0005] In a first aspect, a transaction channel management method is provided, which is applied to intelligent routing. The method comprises: listening to a notification message generated by a transaction channel after receiving a transaction request sent by a transaction channel invoker; according to the notification message and a current channel state of the transaction channel, transaction request data of the transaction channel is counted; it is judged whether the transaction request data meets a preset condition for changing the current channel state; if the preset condition is met, the current channel state is changed to a preset state corresponding to the preset condition.

[0006] In a preferred embodiment, according to the notification message and the current channel state of the transaction channel, the transaction request data of the transaction channel is counted, which comprises: if the current channel state is a normal state, the number of normal transactions, the number of normal transaction success requests, the number of normal transaction continuous failure requests and the continuous failure request time are counted according to the number of notification messages and the transaction results in the notification messages; if the current channel state is a semi-open state, the semi-open transaction total request number, the semi-open transaction success request number and the semi-open transaction failure request number are counted according to the number of notification messages and the transaction results in the notification messages.

[0007] In a preferred embodiment, if the current channel state is the normal state, the method further comprises: if the interface mode of the transaction channel is the synchronous mode, determining the total number of normal transaction requests according to the number of the notification messages, determining the number of successful normal transaction requests according to the transaction results in the notification messages, determining the number of continuously failed normal transaction requests and the duration of the continuously failed normal transaction requests; if the interface mode of the transaction channel is the asynchronous mode, determining the total number of normal transaction requests according to the number of the accepted notification messages in the notification messages, determining the number of successful normal transaction requests according to the transaction results in the result notification messages, determining the number of continuously failed normal transaction requests and the duration of the continuously failed normal transaction requests.

[0008] In a preferred embodiment, if the current channel state is the normal state, the method further comprises: determining the failure rate of the transaction channel according to the total number of normal transaction requests and the number of successful normal transaction requests; if the interface mode of the transaction channel is the synchronous mode, the judgment of whether the transaction request data satisfies the preset condition for changing the current channel state comprises: judging whether the failure rate satisfies a first preset fuse condition or the transaction request data satisfies a second preset fuse condition; wherein the first preset fuse condition and the second preset fuse condition are used to trigger the fuse of the intelligent routing to open, so as to change the normal state to the fuse state; the first preset fuse condition is that the failure rate is greater than or equal to a first failure rate threshold; the second preset fuse condition is that the number of continuously failed normal transaction requests is greater than a normal transaction continuous failure request threshold and the duration of the continuously failed normal transaction requests is greater than a normal transaction continuous failure duration threshold.

[0009] In a preferred embodiment, if the interface mode of the transaction channel is the asynchronous mode and only the failure rate satisfies the first preset fuse condition, the method further comprises: determining the actual failure rate according to the real-time transaction request data called from the database; the judgment of whether the transaction request data satisfies the preset condition for changing the current channel state comprises: judging whether the actual failure rate satisfies the first preset fuse condition.

[0010] In a preferred embodiment, if the current channel state is the semi-open state, the method further comprises: obtaining the number of pre-configured detection samples of the transaction channel; determining the early fuse error threshold and the early recovery success threshold according to the total number of semi-open transaction requests, the number of detection samples and a second failure rate threshold.

[0011] In a preferred embodiment, if the interface mode of the transaction channel is a synchronous mode, the judging whether the transaction request data satisfies the preset condition for changing the current channel state comprises: judging whether the semi-open-close failure request number satisfies a third preset fuse condition; if not, judging whether the semi-open-close success request number satisfies a first preset recovery condition; if not, judging whether the semi-open-close total request number is greater than or equal to the detection sample number; if yes, judging whether the actual semi-open-close transaction failure request number satisfies a fourth preset fuse condition or a second preset recovery condition; wherein the third preset fuse condition and the fourth preset fuse condition are used to trigger the fuse to open, and the first preset recovery condition and the second preset recovery condition are used to trigger the fuse to close; the third preset fuse condition is that the semi-open-close failure request number is greater than or equal to the early fuse error threshold value; the first preset recovery condition is that the semi-open-close success request number is greater than the early recovery success threshold value; the fourth preset fuse condition is that the actual semi-open-close failure request number is greater than or equal to the semi-open-close failure request number threshold value; the second preset recovery condition is that the actual semi-open-close failure request number is less than the semi-open-close failure request number threshold value; the actual semi-open-close failure request number is determined according to the semi-open-close transaction total request number and the semi-open-close transaction success request number, and the semi-open-close transaction failure request number threshold value is determined according to the semi-open-close transaction total request number and the second failure rate threshold value.

[0012] In a preferred embodiment, if the interface mode is an asynchronous mode, before the judging whether the actual semi-open-close transaction failure request number satisfies the fourth preset fuse condition or the second preset recovery condition, it further comprises: judging whether the semi-open-close transaction total request number is equal to the sum of the semi-open-close transaction failure request number and the semi-open-close transaction success request number; if yes, judging whether the actual semi-open-close transaction failure request number satisfies the fourth preset fuse condition or the second preset recovery condition.

[0013] In a preferred embodiment, if the preset state is a fuse state, after the current channel state is changed to the preset state corresponding to the preset condition, it further comprises: acquiring a pre-configured wake-up time of the transaction channel; after the continuous fuse time of the fuse state reaches the wake-up time, changing the fuse state to a semi-open-close state.

[0014] In a second aspect, a management device of a transaction channel is provided, which is applied to intelligent routing, and the device comprises: a listening module configured to listen to a notification message generated by a transaction channel after the transaction channel receives a transaction request sent by a transaction channel invoker; a statistical module configured to statistically analyze transaction request data of the transaction channel according to the notification message and a current channel state of the transaction channel; a judgment module configured to judge whether the transaction request data meets a preset condition for changing the current channel state; and a changing module configured to change the current channel state into a preset state corresponding to the preset condition if the preset condition is met.

[0015] In the present application, when the transaction channel in the normal state or the semi-open state has abnormal transaction request data or the sample detection result does not meet the recovery condition, the fuse is turned on in time, so that the subsequent transaction request is prevented from passing through the transaction channel again, the processing time of the transaction request is prevented from being too long, and the number of abnormal orders is prevented from increasing. On the other hand, when the sample detection result of the transaction channel in the semi-open state meets the recovery condition, the fuse is turned off in time, the channel state is restored to the normal state, the transaction channel in the normal state is opened in time, the pressure on other transaction channels is prevented from being too large, and the stability of the transaction system is improved as a whole. BRIEF DESCRIPTION OF DRAWINGS

[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0017] Figure 1 The management method flowchart of the transaction channel in the embodiment of the present application;

[0018] Figure 2 The switching schematic diagram of different channel states in the embodiment of the present application;

[0019] Figure 3 The transaction request data statistical flowchart in the embodiment of the present application;

[0020] Figure 4 The judgment flowchart of whether the preset condition is met in the normal state in the embodiment of the present application;

[0021] Figure 5 The judgment flowchart of whether the preset condition is met in the semi-open state in the embodiment of the present application;

[0022] Figure 6 The schematic diagram of the management device of the transaction channel in the embodiment of the present application;

[0023] Figure 7 Architecture diagram of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION

[0024] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and should not be used to limit the present application.

[0025] The transaction channel management method and system of the present application will be described in detail below with reference to the accompanying drawings.

[0026] As shown in Figure 1 A transaction channel management method applied in intelligent routing, which comprises:

[0027] S101, listening to a notification message generated by a transaction channel after receiving a transaction request sent by a transaction channel invoker.

[0028] In this step, the transaction channel can be subdivided into virtual channels for different transaction processing parties under a certain business channel, such as a certain bank and a certain card type. The transaction channel invoker sends a transaction request to the transaction channel. The transaction channel generates a notification message after receiving the transaction request. If the interface mode of the transaction channel is synchronous mode, the transaction channel directly generates a notification message of the transaction result and sends it to the transaction channel invoker. If the interface mode of the transaction channel is asynchronous mode, the transaction channel first generates a notification message of the acceptance class according to the transaction request and sends it to the transaction channel invoker, and then generates a result class notification message containing the transaction result and calls back to the transaction channel invoker. At this time, the result class notification message is a callback type information.

[0029] S102, according to the notification message and the current channel state of the transaction channel, statistics the transaction request data of the transaction channel.

[0030] In the present application, a corresponding fuse is set for each channel. The channel state includes normal state, semi-open state and fuse state. The principle of the fuse is as shown in Figure 2As shown, the fuse is closed, at this time the channel state is normal state, the transaction request can normally go through this channel. When the fuse condition is reached, the fuse is opened, at this time all transaction requests cannot go through this channel. After the channel fuse is opened, the wake-up time configured by the channel fuse strategy is reached, the channel is woken up and enters a semi-open state, at this time the intelligent routing will detect samples according to the channel fuse strategy configuration, the detection sample is used to detect whether the fuse of the channel is further opened or closed, at this time, a small amount of transaction requests meeting the number requirement of the detection sample can go through this channel. When the sample detection result meets the corresponding fuse condition, the fuse is closed, at this time the channel enters the fuse state, when the sample detection result meets the corresponding recovery condition, the channel returns to the normal state, at this time, the transaction request can normally go through this channel.

[0031] In this step, the notification message contains the corresponding channel identifier, and the intelligent routing obtains the corresponding current channel state according to the channel identifier after listening to the notification message. In different current channel states, the corresponding preset conditions are different, so the statistical transaction request data required by different current channel states is different, and in different interface modes, the types of notification messages are different, so the application is based on the number and type of notification messages and the current channel state to statistically analyze the transaction request data of the transaction channel.

[0032] The transaction request data includes the total number of transaction requests, the number of successful transaction requests, the number of failed transaction requests, the number of consecutive failed normal transaction requests, and the duration of consecutive failed normal transaction requests. The total number of transaction requests is the number of transaction requests initiated by the transaction channel invoker, the number of successful transaction requests is the number of successful transaction requests, the number of failed transaction requests is the number of failed transaction requests, the number of consecutive failed normal transaction requests is the number of consecutive failed transaction requests, and the duration of consecutive failed normal transaction requests is the duration of consecutive failed transaction requests.

[0033] S103, determine whether the transaction request data meets the preset condition of changing the current channel state.

[0034] S104, if the preset condition is met, the current channel state is changed to the preset state corresponding to the preset condition.

[0035] In the above steps, if the current channel state is normal, it is determined whether the corresponding fuse condition is met according to the transaction request data, so as to trigger the fuse to open and change the normal state to the fuse state, if the current channel state is semi-open, it is determined whether the corresponding fuse condition and recovery condition are met according to the current transaction data, so as to trigger the fuse to open or close, and change the semi-open state to the fuse state or the normal state.

[0036] In the present application, the intelligent routing listens to the transaction channel after receiving the notification message generated by the transaction channel invoker sending the transaction request, and according to the notification message and the current channel state of the transaction channel, the transaction request data of the transaction channel is counted, so as to be suitable for the counting of transaction request data under different channel states and different interface modes, and has a relatively wide range of application. Further, it is judged whether the transaction request data meets the preset condition for changing the current channel state. If the preset condition is met, the current channel state is changed to the preset state corresponding to the preset condition, so that on the one hand, for the transaction channel in normal state or semi-open state, when the transaction request data is abnormal or the sample detection result does not meet the recovery condition, the fuse is opened in time to avoid the long transaction request processing time caused by the subsequent transaction request through the transaction channel, thereby causing poor user experience. On the other hand, for the transaction channel in semi-open state, when the sample detection result meets the recovery condition, the fuse is closed in time to restore the channel state to the normal state, so that the transaction channel in normal state can be opened in time to avoid the pressure on other transaction channels, thereby reducing the number of abnormal orders, improving user experience, improving the income of enterprises, and improving the stability of the entire transaction system. Further, after the channel state is changed, the intelligent routing can automatically remove and automatically route to the next priority transaction channel, reduce the degree of human participation, and improve the stability and robustness of the transaction system.

[0037] In a preferred embodiment, counting the transaction request data of the transaction channel according to the notification message and the current channel state of the transaction channel comprises:

[0038] If the current channel state is normal state, the total number of normal transactions, the number of successful normal transactions, the number of consecutive failed normal transactions, and the consecutive failure request time are counted according to the number of notification messages and the transaction results in the notification messages.

[0039] If the current channel state is semi-open state, the total number of semi-open transactions, the number of successful semi-open transactions, and the number of failed semi-open transactions are counted according to the number of notification messages and the transaction results in the notification messages.

[0040] In this step, for different current channel states, the corresponding preset conditions are different, so the counted transaction request data is different. In the normal state, in addition to counting the total number of normal transactions and the number of successful normal transactions, the number of consecutive failed normal transactions and the consecutive failure duration of normal transactions are also counted. In the semi-open state, in addition to counting the total number of semi-open transactions and the number of successful semi-open transactions, the number of failed semi-open transactions is also counted.

[0041] In this invention, different transaction request data are statistically analyzed when the transaction channel is in different channel states, thus making it applicable to channel management under different channel states and having a wide range of applications.

[0042] In a preferred embodiment, if the current channel status is normal, the method further includes:

[0043] If the interface mode of the transaction channel is synchronous mode, the total number of normal transaction requests is counted based on the number of notification messages, the number of successful normal transaction requests, the number of consecutive failed normal transaction requests, and the duration of consecutive failed normal transactions are counted based on the transaction results in the notification messages.

[0044] If the interface mode of the transaction channel is asynchronous, the total number of normal transaction requests is counted based on the number of acceptance-type notification messages in the notification messages, and the number of successful normal transaction requests, the number of consecutive failed normal transaction requests, and the duration of consecutive failed normal transactions are counted based on the transaction results in the result-type notification messages.

[0045] In this step, the intelligent router can determine the interface mode of the transaction channel based on the channel identifier. In synchronous mode, a notification message represents a transaction request and a transaction result. In asynchronous mode, notification messages are divided into acceptance notification messages and result notification messages. Acceptance notification messages represent a transaction request, and result notification messages represent a transaction result.

[0046] The method in this embodiment is also applicable to determining the total number of half-open / closed transaction requests, the number of successful half-open / closed transaction requests, and the number of failed half-open / closed transaction requests in the half-open / closed state.

[0047] like Figure 3 The diagram illustrates the process for determining transaction request data in this invention. After the intelligent router detects a notification message, it obtains the channel identifier and then uses the channel identifier to determine the current channel status.

[0048] If the current channel state is a normal state, it is further judged whether the notification message is a non-terminal state message, the non-terminal state message is a handling class message, and the terminal state message is a notification message containing a transaction result. In the synchronization mode, the notification message is terminal, and in the asynchronous mode, the notification message can be terminal or non-terminal. Therefore, if the notification message is non-terminal, it is a handling class notification message, and the normal transaction total request number is incremented. If the notification message is not non-terminal, it is further judged whether the transaction result is successful or failed. If it is failed, the normal transaction continuous failure request number is incremented, and it is further judged whether the transaction continuous failure total request number is 1. If it is 1, the current transaction time is the transaction continuous failure start time. If it is successful, the transaction success request number is incremented, and the normal transaction continuous failure request number is reset to zero. At this time, the current transaction time is the transaction continuous failure end time, and the normal transaction continuous failure duration is the difference between the transaction continuous failure end time and the transaction continuous failure start time. Further, corresponding to the terminal state, it is further judged whether the notification message is a callback class message. In the synchronization mode, the notification message is not a callback class message, so the transaction total request number is incremented. In the asynchronous mode, since the handling class notification message of the transaction request has been incremented once, the transaction total request number is not incremented.

[0049] If the current channel state is a semi-closed state, if the interface mode of the transaction channel is a synchronization mode, the semi-closed transaction total request number is counted according to the number of notification messages, and the semi-closed transaction success request number and the semi-closed transaction failure request number are counted according to the transaction result in the notification message. If the interface mode of the transaction channel is an asynchronous mode, the semi-closed transaction total request number is determined according to the number of handling class notification messages in the notification message, and the semi-closed transaction success request number and the semi-closed transaction failure request number are counted according to the transaction result in the result class notification message, as shown in Figure 3 , which will not be repeated here.

[0050] In the present application, there are corresponding transaction request data determination methods for different channel states and different modes, which realize the differential processing of the synchronization mode and the asynchronous mode.

[0051] Further, the transaction request data recorded in the local intelligent routing is synchronized to the remote redis (Remote DIctionary Server, data structure server) at regular intervals for subsequent summary calculation. The timer in the intelligent routing finds the channel that meets the cleaning time, and then calculates the hash field of the transaction total request number and the transaction success request number of the channel in a period of time before the current time. When the timer is executed, the hash field outside the window is cleaned.

[0052] In a preferred embodiment, if the current channel state is the normal state, the step of judging whether the transaction request data satisfies the preset condition for changing the current channel state further comprises:

[0053] determining the failure rate according to the total number of normal transaction requests and the number of successful normal transaction requests;

[0054] If the interface mode of the transaction channel is the synchronous mode, the step of judging whether the transaction request data satisfies the preset condition for changing the current channel state comprises:

[0055] judging whether the failure rate satisfies a first preset fuse condition or whether the transaction request data satisfies a second preset fuse condition;

[0056] The first preset fuse condition and the second preset fuse condition are used to trigger the fuse of the intelligent routing to open, so as to change the normal state to the fuse state; the first preset fuse condition is that the failure rate is greater than or equal to a first failure rate threshold; the second preset fuse condition is that the number of consecutive failed normal transaction requests is greater than a number threshold of consecutive failed normal transaction requests and the duration of consecutive failed normal transaction is greater than a duration threshold of consecutive failed normal transaction.

[0057] In the embodiment, for the transaction channel in the normal state, the judgment of the transaction request data comprises two aspects: one aspect is to determine the failure rate according to the total number of normal transaction requests and the number of successful normal transaction requests in the transaction request data, specifically, the failure rate = 1-(the number of successful normal transaction requests / the total number of normal transaction requests), so that when the failure rate is greater than or equal to the first failure rate threshold, it is determined that the preset condition is satisfied, and the fuse is triggered to open; the other aspect is to determine according to the number of consecutive failed normal transaction requests and the duration of consecutive failed normal transaction, when the number of consecutive failed normal transaction requests is greater than the number threshold of consecutive failed normal transaction requests and the duration of consecutive failed normal transaction is greater than the duration threshold of consecutive failed normal transaction, it is determined that the preset condition is satisfied, and the fuse is triggered to open, that is, as long as any one of the first preset fuse condition or the second preset fuse condition is satisfied, the fuse is triggered to open.

[0058] In a preferred embodiment, if the interface mode of the transaction channel is the asynchronous mode and only the failure rate satisfies the first preset fuse condition, the method further comprises:

[0059] determining the actual failure rate according to the real-time transaction request data called from the database;

[0060] The step of judging whether the transaction request data satisfies the preset condition for changing the current channel state comprises:

[0061] judging whether the actual failure rate satisfies the first preset fuse condition.

[0062] In the present application, in the case that the channel state is normal state, if the interface mode of the transaction channel is asynchronous mode, the following cases exist: first, the failure rate meets the first preset fuse condition, the transaction request data does not meet the second preset fuse condition; second, the failure rate does not meet the first preset fuse condition, the transaction request data meets the second preset fuse condition; third, the failure rate meets the first preset fuse condition, the transaction request data meets the second preset fuse condition; fourth, the failure rate does not meet the first preset fuse condition, the transaction request data does not meet the second preset fuse condition. For the second and third cases, the fuse is directly triggered to open. For the fourth case, the fuse cannot be triggered to open. For the first case, since there is a time difference in the asynchronous mode, the failure rate calculated by the intelligent routing local statistics may not be the real failure rate, so the real failure rate needs to be determined from the real-time transaction request data called from the database. The specific calculation method is the same as the calculation method of the failure rate, and then it is judged whether the real failure rate meets the first preset fuse condition.

[0063] In the present application, for the trigger of the fuse opening determined by the failure rate in the asynchronous mode, a sliding window offset value configuration is provided, and a double-check actual failure rate mechanism is provided to prevent mis-fusing, thereby improving the accuracy of the channel state change.

[0064] As shown in Figure 4 The judgment flow of the present application in the case that the channel state is normal state is shown in the figure. The timer in the intelligent routing will periodically query the transaction channel meeting the condition, and obtain the fuse strategy of the transaction channel. The current time is taken as the statistical end time, and the difference between the current time and the time interval pre-configured in the fuse strategy is taken as the statistical start time. Then it is further judged whether the interface mode is asynchronous mode. If it is asynchronous mode, the asynchronous time pre-configured in the fuse strategy needs to be subtracted when the statistical end time is determined. Whether it is synchronous mode or asynchronous mode, after the statistical end time and the statistical start time are determined, the total number of normal transactions in this period of time is obtained. If the total number of normal transactions is greater than or equal to the minimum number of requests in the fuse strategy, the number of normal successful transaction requests, the number of normal transaction continuous failure requests and the duration of normal transaction continuous failure are further counted, otherwise, no further counting is performed. Then, the failure rate is calculated, and it is judged whether the first preset fuse condition or the second preset fuse condition is met. If the judgment result is met, in the synchronous mode, the fuse is triggered to open, and in the asynchronous mode, it is further judged whether only the first preset fuse condition is met. If so, the actual failure rate is further determined, and it is judged whether the first preset fuse condition is met. If so, the fuse is triggered to open.

[0065] In a preferred embodiment, if the current channel state is semi-open state, before judging whether the transaction request data meets the preset condition for changing the current channel state, the following steps are further included:

[0066] obtaining a detection sample number pre-configured for the transaction channel;

[0067] determining an early fuse error threshold and an early recovery success threshold according to the total number of semi-open-close transactions, the detection sample number, and the second failure rate threshold.

[0068] In the embodiment, for the transaction channel in the semi-open-close state, the intelligent routing first obtains a detection sample number pre-configured for the transaction channel, which is the number of transaction requests that can enter the transaction channel in the semi-open-close state.

[0069] After the total number of semi-open-close transactions and the detection sample number are determined, the maximum of the total number of semi-open-close transactions and the detection sample number is taken as a base number, the early fuse error threshold = the base number * the second failure rate threshold * a coefficient, the value of the coefficient is pre-configured, and the early recovery success threshold = the base number - the early fuse error threshold.

[0070] In a preferred embodiment, if the interface mode of the transaction channel is a synchronous mode, the judgment of whether the transaction request data satisfies the preset condition for changing the current channel state is:

[0071] judging whether the number of semi-open-close failed requests satisfies a third preset fuse condition;

[0072] If not, judging whether the number of semi-open-close successful requests satisfies a first preset recovery condition;

[0073] If not, judging whether the total number of semi-open-close transactions is greater than or equal to the detection sample number;

[0074] If yes, judging whether the actual number of semi-open-close failed transactions satisfies a fourth preset fuse condition or a second preset recovery condition;

[0075] The third preset fuse condition and the fourth preset fuse condition are used to trigger the fuse to open, and the first preset recovery condition and the second preset recovery condition are used to trigger the fuse to close. The third preset fuse condition is that the number of semi-open-close failed requests is greater than or equal to the early fuse error threshold. The first preset recovery condition is that the number of semi-open-close successful requests is greater than the early recovery success threshold. The fourth preset fuse condition is that the actual number of semi-open-close failed transactions is greater than or equal to the number of semi-open-close failed requests threshold. The second preset recovery condition is that the actual number of semi-open-close failed transactions is less than the number of semi-open-close failed requests threshold. The actual number of semi-open-close failed transactions is determined according to the total number of semi-open-close transactions and the number of semi-open-close successful transactions. The number of semi-open-close failed requests threshold is determined according to the total number of semi-open-close transactions and the second failure rate threshold.

[0076] As Figure 5The shown is the judgment flow in the half-open state of the application, first, judge whether the half-open failure request number is greater than or equal to the early fuse error threshold, if yes, the third preset fuse condition is met, the fuse is triggered to open, if not, further judge whether the half-open success request number is early recovery success threshold, if yes, the first preset recovery condition is met, the fuse is triggered to close, if not, further judge whether the half-open total request number is greater than or equal to the detection sample number, if not, it indicates that the condition of changing the half-open state is not met, if yes, further calculate the actual half-open failure request number and the half-open transaction failure request number threshold, the actual half-open failure request number = half-open transaction total request number-half-open transaction success request number, the half-open transaction failure request number threshold = according to the half-open transaction total request number*second failure rate threshold, further compare the size of the actual half-open transaction failure request number and the half-open transaction failure request number threshold, if the actual half-open failure request number is greater than or equal to the half-open failure request number threshold, the fourth preset fuse condition is met, the fuse is triggered to open, if the actual half-open failure request number is less than the half-open failure request number threshold, the second preset recovery condition is met, the fuse is triggered to close.

[0077] In a preferred embodiment, if the interface mode is asynchronous mode, before judging whether the actual half-open transaction failure request number meets the fourth preset fuse condition or the second preset recovery condition, it further includes:

[0078] Judge whether the half-open transaction total request number is equal to the sum of the half-open transaction failure request number and the half-open transaction success request number;

[0079] If equal, judge whether the actual half-open transaction failure request number meets the fourth preset fuse condition or the second preset recovery condition.

[0080] In this embodiment, continue to refer to Figure 5 After judging that the half-open total request number is greater than or equal to the detection sample number, further judge the interface mode, for the synchronous interface mode, directly judge whether the actual half-open transaction failure request number meets the fourth preset fuse condition or the second preset recovery condition, and for the asynchronous mode, before this, it is necessary to further judge whether the half-open transaction total request number is equal to the sum of the half-open transaction failure request number and the half-open transaction success request number, only when this condition is met, further judge whether the half-open state is fused or recovered, if this condition is not met, then the condition of changing the half-open state is not met.

[0081] In a preferred embodiment, if the preset state is the fuse state, after changing the current channel state to the preset state corresponding to the preset condition, it further includes:

[0082] Obtain the wake-up time of the pre-configured transaction channel;

[0083] After the continuous fusing time of the fusing state reaches the wake-up time, the fusing state is changed to the semi-open-close state.

[0084] In the embodiment, for the transaction channel in the fusing state, the intelligent routing acquires the preconfigured wake-up time thereof, when the continuous fusing time of the fusing state reaches the wake-up time, the fusing state is changed to the semi-open-close state, and further, the number of detection samples in the fusing strategy of the transaction channel is configured as the detection samples thereof, part of the transaction requests are allowed to enter the transaction channel, and further, whether to further fuse or recover is judged according to the detection result, so that on the one hand, the state can be recovered in time after the transaction channel is eliminated, and on the other hand, the transaction channel can still be kept in the fusing state when the transaction channel is still not eliminated, so as to avoid the problem that the transaction request processing time is long due to the subsequent transaction requests entering the transaction channel.

[0085] Further, after the detection time is met, the detection result of the statistical detection sample is started. When the detection result is listened to, the intelligent routing adopts a two-level decreasing mechanism for the statistics of the number of detection samples, the application program local and remote redis are initialized to configure the detection sample, the local detection sample number is first decreased, and then the remote redis detection sample number is decreased after success, so as to prevent the traffic peak from pressing the redis; if the local detection sample number is less than 0, the local detection sample number is not decreased any more, if greater than or equal to 0, the remote detection sample number is acquired, and whether it is equal to 0 is judged, if equal to 0, the judgment of the semi-open-close fusing opening or closing is delayed for a period of time, and then whether the remote detection sample number is less than 0 is judged, if not equal to 0, the remote detection sample number is directly judged whether it is less than 0, if less than 0, the remote detection sample number is decreased, and if not, the remote detection sample number is not decreased.

[0086] In actual application, part of the channel interfaces need to show whether the semi-open-close channel is available when inquiring the channel related data for display, at this time, the intelligent routing only needs to judge whether the number of detection samples is exhausted, the local detection sample number is first acquired, if the local detection sample number is less than or equal to 0, it indicates that it has been exhausted, if not, whether the remote detection sample number is less than or equal to 0 is judged, if yes, it indicates that it has been exhausted, if not, it indicates that it has not been exhausted, so that the access of the remote redis can be effectively reduced, and the situation that the channel state is shelved and the result is lost can be prevented.

[0087] As shown in Figure 6 The application further provides a management device of a transaction channel, applied to an intelligent routing, the device comprises:

[0088] The listening module 601 is configured to listen to a notification message generated by the transaction channel after receiving a transaction request sent by a transaction channel invoker;

[0089] a statistics module 602, configured to count transaction request data of the transaction channel according to the notification message and a current channel state of the transaction channel;

[0090] a judgment module 603, configured to judge whether the transaction request data satisfies a preset condition for changing the current channel state;

[0091] a changing module 604, configured to change the current channel state into a preset state corresponding to the preset condition if the preset condition is satisfied.

[0092] In a preferred embodiment, the statistics module 602 comprises a first statistics unit, configured to count a total number of normal transactions, a number of successful normal transactions, a number of consecutive failed normal transactions and a consecutive failed normal transaction time according to a number of the notification messages and transaction results in the notification messages if the current channel state is the normal state; and a second statistics unit, configured to count a total number of semi-open-close transactions, a number of successful semi-open-close transactions and a number of failed semi-open-close transactions according to the number of the notification messages and the transaction results in the notification messages if the current channel state is the semi-open-close state.

[0093] In a preferred embodiment, the first statistics unit further comprises a first statistics sub-unit, configured to determine the total number of normal transactions according to the number of the notification messages, and determine the number of successful normal transactions, the number of consecutive failed normal transactions and a consecutive failed normal transaction duration according to the transaction results in the notification messages if an interface mode of the transaction channel is a synchronous mode; and a second statistics sub-unit, configured to count the total number of normal transactions according to a number of accepted notification messages in the notification messages if the interface mode of the transaction channel is an asynchronous mode, and determine the number of successful normal transactions, the number of consecutive failed normal transactions and the consecutive failed normal transaction duration according to the transaction results in the result notification messages.

[0094] In a preferred embodiment, the apparatus further comprises a determination module, configured to determine a failure rate of the transaction channel according to the total number of normal transactions and the number of successful normal transactions; and the judgment module 603 is further configured to judge whether the failure rate satisfies a first preset fuse condition or whether the transaction request data satisfies a second preset fuse condition if the interface mode of the transaction channel is the synchronous mode; wherein the first preset fuse condition and the second preset fuse condition are used to trigger a fuse of the intelligent routing to open, so as to change the normal state into a fuse state; the first preset fuse condition is that the failure rate is greater than or equal to a first failure rate threshold; and the second preset fuse condition is that the number of consecutive failed normal transactions is greater than a number of consecutive failed normal transaction threshold and the consecutive failed normal transaction duration is greater than a consecutive failed normal transaction duration threshold.

[0095] In a preferred embodiment, if the interface mode of the transaction channel is asynchronous mode and only the failure rate meets the first preset fuse condition, the determining module is further configured to determine an actual failure rate according to real-time transaction request data called from the database; and the judging module 603 is further configured to judge whether the actual failure rate meets the first preset fuse condition.

[0096] In a preferred embodiment, the device further comprises an obtaining module configured to obtain a preconfigured probe sample number of the transaction channel; and the determining module is further configured to determine the early fuse error threshold and the early recovery success threshold according to the total number of semi-open-close transactions, the probe sample number and the second failure rate threshold.

[0097] In a preferred embodiment, if the interface mode of the transaction channel is synchronous mode, the judging module 603 is further configured to judge whether the number of semi-open-close failed requests meets a third preset fuse condition; if not, judge whether the number of semi-open-close successful requests meets a first preset recovery condition; if not, judge whether the total number of semi-open-close requests is greater than or equal to the probe sample number; if yes, judge whether an actual number of semi-open-close transaction failed requests meets a fourth preset fuse condition or a second preset recovery condition; wherein the third preset fuse condition and the fourth preset fuse condition are used to trigger the fuse to open, and the first preset recovery condition and the second preset recovery condition are used to trigger the fuse to close; the third preset fuse condition is that the number of semi-open-close failed requests is greater than or equal to the early fuse error threshold; the first preset recovery condition is that the number of semi-open-close successful requests is greater than the early recovery success threshold; the fourth preset fuse condition is that the actual number of semi-open-close transaction failed requests is greater than or equal to the number of semi-open-close failed requests threshold; the second preset recovery condition is that the actual number of semi-open-close transaction failed requests is less than the number of semi-open-close failed requests threshold; the actual number of semi-open-close transaction failed requests is determined according to the total number of semi-open-close transactions and the number of semi-open-close transaction successful requests; and the number of semi-open-close failed requests threshold is determined according to the total number of semi-open-close transactions and the second failure rate threshold.

[0098] In a preferred embodiment, if the interface mode is asynchronous mode, the judging module 603 is further configured to judge whether the total number of semi-open-close transactions is equal to the sum of the number of semi-open-close transaction failed requests and the number of semi-open-close transaction successful requests; if yes, judge whether the actual number of semi-open-close transaction failed requests meets the fourth preset fuse condition or the second preset recovery condition.

[0099] In a preferred embodiment, if the preset state is the fuse state, the obtaining module is further configured to obtain a preconfigured wake-up time of the transaction channel; and the changing module 604 is further configured to change the fuse state to the semi-open-close state after the continuous fuse time of the fuse state reaches the wake-up time.

[0100] The beneficial effects of the management device of the transaction channel in the present application are described in the management method of the transaction channel, which will not be repeated here.

[0101] The application further provides an electronic device, comprising:

[0102] one or more processors; and

[0103] a memory associated with the one or more processors, the memory configured to store program instructions that, when executed by the one or more processors, perform the method for managing a transaction channel.

[0104] The implementation process and the technical effects that can be achieved of the embodiments are described in the method for managing a transaction channel, and will not be repeated here.

[0105] The application further provides a computer-readable storage medium having a computer program stored thereon, and the computer program, when executed by a processor, implements the method for managing a transaction channel as described above.

[0106] The application further provides a computer-readable storage medium having a computer program stored thereon, and the computer program, when executed by a processor, implements the method for managing a transaction channel as described above.

[0107] The application further provides an electronic device, comprising: Figure 7 The exemplary electronic device architecture can specifically include a processor 710, a video display adapter 711, a disk drive 712, an input / output interface 713, a network interface 714, and a memory 720. The processor 710, the video display adapter 711, the disk drive 712, the input / output interface 713, the network interface 714, and the memory 720 can be communicatively connected through a communication bus 730.

[0108] The processor 710 can be implemented in a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is configured to execute related programs to implement the technical solutions provided by the application.

[0109] The memory 720 can be implemented in the form of a ROM (Read Only Memory), a RAM (Random Access Memory), a static storage device, a dynamic storage device, etc. The memory 720 can store an operating system 721 for controlling the operation of the computer system, a basic input / output system (BIOS) for controlling the low-level operation of the computer system. In addition, a web browser 723, a data storage management system 724, and a device identification information processing system 725, etc. can also be stored. The device identification information processing system 725 described above can be an application program that specifically implements the operations of the above steps in the embodiments of the present application. In summary, when the technical solutions provided by the present application are implemented by software or firmware, the relevant program codes are stored in the memory 720 and executed by the processor 710.

[0110] The input / output interface 713 is used to connect input / output modules to realize information input and output. The input / output modules can be configured as components in the device (not shown in the figure) or externally connected to the device to provide corresponding functions. The input devices can include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output devices can include a display, a speaker, a vibrator, an indicator light, etc.

[0111] The network interface 714 is used to connect a communication module (not shown in the figure) to realize the communication interaction between the device and other devices. The communication module can realize communication through wired means (such as USB, network cable, etc.) or through wireless means (such as mobile network, WIFI, Bluetooth, etc.).

[0112] The bus 730 includes a path for transmitting information between various components of the device (such as the processor 710, the video display adapter 711, the disk drive 712, the input / output interface 713, the network interface 714, and the memory 720).

[0113] It should be noted that although the above device only shows the processor 710, the video display adapter 711, the disk drive 712, the input / output interface 713, the network interface 714, the memory 720, the bus 730, etc., in the specific implementation process, the device can also include other components necessary for normal operation. In addition, those skilled in the art can understand that the above device can also only contain the components necessary to implement the present application scheme, and does not have to contain all the components shown in the figure.

[0114] The computer program product of the present application includes a computer program carried on a computer readable medium, which contains program codes for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a memory, or installed from a ROM. When the computer program is executed by a processor, the above-mentioned functions defined in the method of the embodiment of the present application are executed.

[0115] It should be noted that the computer readable medium of the embodiment of the present application can be a computer readable signal medium or a computer readable storage medium or any combination of the two. The computer readable storage medium may, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination of the above. More specific examples of the computer readable storage medium can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the embodiment of the present application, the computer readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or apparatus. In the embodiment of the present application, the computer readable signal medium can include a data signal carried in a baseband or as a part of a carrier wave, which carries computer readable program codes. Such a propagated data signal can take various forms, including but not limited to an electromagnetic signal, an optical signal or any suitable combination of the above. The computer readable signal medium can also be any computer readable medium other than the computer readable storage medium, which can send, propagate or transmit a program for use by or in conjunction with an instruction execution system, device or apparatus. The program codes contained on the computer readable medium can be transmitted by any suitable medium, including but not limited to a wire, an optical cable, an RF (Radio Frequency) cable, etc., or any suitable combination of the above.

[0116] The above-mentioned computer readable medium can be contained in the above-mentioned server; or can exist separately and not be assembled into the server. The above-mentioned computer readable medium carries one or more programs, which, when executed by the server, cause the server to: in response to detecting that the peripheral mode of the terminal is not activated, acquire the frame rate of the application on the terminal; when the frame rate meets the off-screen condition, determine whether the client is acquiring the screen information of the terminal; in response to the determination result that the client is not acquiring the screen information of the terminal, control the screen to enter the immediate dim mode.

[0117] Computer program code for carrying out operations of embodiments of the present application can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).

[0118] The various embodiments in the specification are described in progressive manner, and the same or similar parts among the various embodiments can be mutually referred to, and each embodiment focuses on the difference from other embodiments. In particular, for the system or system embodiments, since they are basically similar to the method embodiments, they are described more simply, and the relevant parts can be referred to the part of the method embodiments. The above described system and system embodiments are merely illustrative, and the units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, i.e., they can be located in one place, or can be distributed to multiple network units. Part or all of the modules can be selected to achieve the purpose of the embodiment according to the actual needs. Those skilled in the art can understand and implement it without creative labor.

[0119] The above describes the management method and device of the transaction channel provided by the present application in detail, and the principle and implementation mode of the present application are described by applying specific examples. The above embodiment is only used to help understand the method and its core idea of the present application; at the same time, for those skilled in the art, according to the idea of the present application, the specific implementation mode and application range will be changed. In summary, the content of the specification should not be understood as a limitation of the present application.

Claims

1. A method for managing transaction channels, characterized in that, When applied to smart routing, the method includes: Listen for the notification message generated by the transaction channel after receiving a transaction request from the transaction channel caller; The transaction request data of the transaction channel is counted based on the notification message and the current channel status; the channel status of the transaction channel includes normal status, semi-open status and circuit breaker status. Determine whether the transaction request data meets the preset conditions for changing the current channel status; If the preset conditions are met, the current channel status will be changed to the preset status corresponding to the preset conditions, including: If the current channel status is normal, determine whether the failure rate meets the first preset circuit breaker condition or whether the transaction request data meets the second preset circuit breaker condition; wherein, the first preset circuit breaker condition and the second preset circuit breaker condition are used to trigger the circuit breaker of the smart route to open, thereby changing the normal status to the circuit breaker status; If the current channel status is half-open / closed, determine whether the number of half-open / closed failed requests meets the third preset circuit breaker condition; if the number of half-open / closed failed requests does not meet the third preset circuit breaker condition, determine whether the number of half-open / closed successful requests meets the first preset recovery condition. If the number of successful half-open / close requests does not meet the first preset recovery condition, then determine whether the total number of half-open / close requests is greater than or equal to the number of probe samples; If the total number of half-open / closed requests is greater than or equal to the number of probe samples, then it is determined whether the number of failed half-open / closed requests meets the fourth preset circuit breaker condition or the second preset recovery condition; wherein, the third preset circuit breaker condition and the fourth preset circuit breaker condition are used to trigger the fuse to open, and the first preset recovery condition and the second preset recovery condition are used to trigger the fuse to close. If the preset state is circuit breaker state, obtain the wake-up time of the pre-configured transaction channel; after the continuous circuit breaker time in the circuit breaker state reaches the wake-up time, change the circuit breaker state to half-open state.

2. The method according to claim 1, characterized in that, The step of statistically analyzing the transaction request data of the transaction channel based on the notification message and the current channel status includes: If the current channel status is normal, then the total number of normal transaction requests, the number of successful normal transaction requests, the number of consecutive normal transaction failures, and the duration of consecutive normal transaction failures are calculated based on the number of notification messages and the transaction results in the notification messages. If the current channel status is a half-open / closed state, then the total number of half-open / closed requests, the number of successful half-open / closed requests, and the number of failed half-open / closed requests are counted based on the number of notification messages and the transaction results in the notification messages.

3. The method according to claim 2, characterized in that, If the current channel status is the normal status, the method further includes: If the interface mode of the transaction channel is synchronous mode, then the total number of normal transaction requests is determined according to the number of notification messages, the number of successful normal transaction requests, the number of consecutive failed normal transaction requests, and the duration of consecutive failed normal transactions are determined according to the transaction results in the notification messages. If the interface mode of the transaction channel is asynchronous, then the total number of normal transaction requests is counted based on the number of acceptance-type notification messages in the notification messages, and the number of successful normal transaction requests, the number of consecutive failed normal transaction requests, and the duration of consecutive failed normal transactions are determined based on the transaction results in the result-type notification messages.

4. The method according to claim 2, characterized in that, If the current channel status is the normal status, then before determining whether the transaction request data meets the preset conditions for changing the current channel status, the method further includes: The failure rate of the transaction channel is determined based on the total number of normal transaction requests and the number of successful normal transaction requests.

5. The method according to claim 4, characterized in that, If the interface mode of the transaction channel is asynchronous and only the failure rate meets the first preset circuit breaker condition, the method further includes: The actual failure rate is determined based on real-time transaction request data retrieved from the database; The condition for determining whether the transaction request data meets the preset condition for changing the current channel status is as follows: Determine whether the actual failure rate meets the first preset circuit breaker condition.

6. The method according to claim 5, characterized in that, If the interface mode of the transaction channel is synchronous mode, then the step of determining whether the transaction request data meets the preset condition for changing the current channel status is: The third preset circuit breaker condition is that the number of half-opening failure requests is greater than or equal to the early circuit breaker error threshold. The first preset recovery condition is that the number of successful half-open / closed requests is greater than the early recovery success threshold; The fourth preset circuit breaker condition is that the number of half-open / closed failure requests is greater than or equal to the threshold number of half-open / closed failure requests; the second preset recovery condition is that the number of half-open / closed failure requests is less than the threshold number of half-open / closed failure requests; the number of half-open / closed failure requests is determined based on the total number of half-open / closed requests and the number of half-open / closed success requests, and the threshold number of half-open / closed failure requests is determined based on the total number of half-open / closed requests and the second failure rate threshold.

7. The method according to claim 6, characterized in that, If the interface mode is asynchronous, then before determining whether the number of half-open / closed failed requests meets the fourth preset circuit breaker condition or the second preset recovery condition, the following steps are also included: Determine whether the total number of half-open / closed requests is equal to the sum of the number of failed half-open / closed requests and the number of successful half-open / closed requests; If equal, then determine whether the number of half-open / closed failure requests satisfies the fourth preset circuit breaker condition or the second preset recovery condition.

8. An apparatus for implementing the management method of the transaction channel according to any one of claims 1 to 7, characterized in that, The device, used in smart routers, includes: The listening module is used to listen for notification messages generated by the transaction channel after receiving a transaction request from the transaction channel caller. The statistics module is used to count the transaction request data of the transaction channel based on the notification message and the current channel status of the transaction channel; The judgment module is used to determine whether the transaction request data meets the preset conditions for changing the current channel status; The change module is used to change the current channel status to the preset status corresponding to the preset conditions if the preset conditions are met.

Citation Information

Patent Citations

  • Distributed bill processing method, device and equipment and computer readable storage medium

    CN110264171A