Transaction verification automatic degradation method and device

By adopting the automatic downgrade method of transaction verification in the network real-time transaction processing service, and using the sliding window to count the number of abnormal transactions and the number of transactions, the problem of being unable to quickly and accurately identify stable abnormalities in the existing technology is solved, and the rapid hemostasis and smooth abnormalities are handled, ensuring the stability of the transaction link.

CN120186019APending Publication Date: 2025-06-20NETSUNION CLEARING CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311760814.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-20
Publication Date
2025-06-20

AI Technical Summary

Technical Problem

When calling the transaction verification service, the existing networked real-time transaction processing service has the problem of not being able to quickly and accurately identify stable abnormalities, resulting in the inability to take into account both rapid hemostasis and smooth burst amplification abnormalities, and the inability to perceive abnormalities across the inspection time node.

Method used

An automatic downgrade method for transaction verification is adopted. The timing task is started per time slice, the number of abnormal transactions and transactions is counted, and the total number of abnormal transactions and transactions is calculated based on the data in the sliding window to determine whether the downgrade is started. Through the sliding window mechanism, this method can accurately count abnormal traffic data, smooth the abnormality of burst and check nodes across timed tasks.

Benefits of technology

It realizes rapid and accurate identification of abnormalities, can promptly downgrade services, avoid transaction damage, ensure the stability of real-time transaction links, and avoid the avalanche effect. At the same time, the size of the time slice can be adjusted freely, and the fineness of traffic statistics can be flexibly controlled to avoid error degradation caused by network jitter.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120186019A_ABST
    Figure CN120186019A_ABST
Patent Text Reader

Abstract

The invention relates to the field of traffic statistics, and provides an automatic degradation method and device for transaction verification, which are applied to a transaction processing system, and the method comprises the steps: starting a timed task at each time slice, so as to count the number of abnormal transactions when calling services are abnormal and the number of transactions of the calling services in the time slice; according to the number of abnormal strokes and the number of transactions in the sliding window, the total number of abnormal strokes and the total number of transactions are calculated, and the time period of the sliding window comprises the recent preset number of time slices; and judging whether to start degradation or not according to the total abnormal number and the total transaction number. According to the method, real abnormal traffic data in the latest time period can be accurately counted, and sudden increase abnormal traffic and abnormal traffic of cross-timed task check nodes can be well smoothed. No matter how the abnormal flow distribution condition in a short time period is, the numerical value of the abnormal flow can be accurately calculated. And the size of the time slice can be freely adjusted, so that the flow statistics fine degree of different services can be flexibly controlled.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This document relates to the field of traffic statistics, and particularly to an automatic downgrading method and device for transaction verification. Background Art

[0002] As a financial infrastructure, the system stability and business continuity of the network union are very important. In the current real-time transaction link of the network union, thousands of transactions can be executed per second under normal conditions, and tens of thousands of transactions can occur per second at the peak. Therefore, the current real-time transactions of the network union have the characteristic of a huge concurrency volume. In the existing network union system architecture, as Figure 1 shown, the real-time transaction link includes an institutional front-end service, a real-time transaction processing service, a transaction verification service, and a bank front-end service. In the existing real-time transaction processing service of the network union, the statistics and downgrading judgment logic is executed once per minute in the form of a scheduled task to determine whether the abnormal threshold is reached, so as to decide whether to trigger the service downgrading operation, so as to meet the requirements of automated operation and maintenance for automatically downgrading and isolating bleeding when non-core services such as the transaction verification service fail. The transaction processing service starts a scheduled task at regular time intervals, and the scheduled task performs traffic statistics and downgrading judgment. Specifically, the traffic statistics and downgrading judgment process includes: after the transaction processing service receives each transaction request, it calls the verification system and counts the number of abnormal calls to the verification system in the kernel of this scheduled task; when the scheduled task reaches the trigger time, it checks whether the number of system abnormal calls reaches the threshold. If the threshold is reached, it is considered that the system downgrading condition is met, and the downgrading operation is executed.

[0003] The existing downgrading judgment logic has the following defects: it cannot balance rapid hemostasis and smooth sudden increase in abnormalities; it cannot sense abnormalities that cross the inspection time node. Summary of the Invention

[0004] This document is used to solve the problem that the existing abnormal downgrading judgment logic cannot quickly and accurately identify stable abnormalities when the real-time transaction processing service of the network union calls the transaction verification service.

[0005] To solve the above technical problems, on the one hand, this document provides an automatic downgrading method for transaction verification, which is applied to a transaction processing system and includes:

[0006] Starting a scheduled task for each time slice, and the scheduled task is used to count the number of abnormal calls to the service and the number of transaction calls to the service within the time slice;

[0007] Calculating the total number of abnormal calls and the total number of transaction calls according to the number of abnormal calls and the number of transaction calls within the sliding window, where the time period of the sliding window includes the most recent predetermined number of time slices;

[0008] Judging whether to start downgrading according to the total number of abnormal calls and the total number of transaction calls.

[0009] In a further embodiment of this article, a timing task is started for each time slice. The timing task counts the number of abnormal records of service calls and the number of transaction records of service calls within the time slice, including:

[0010] Start a timing task for each time slice, and initialize a first counter for storing the number of transaction records and a second counter for storing the number of abnormal records;

[0011] For each received transaction request, control the first counter to increment by one, and call the transaction verification service. If the call is abnormal, control the second counter to increment by one;

[0012] Calculate the trigger time of the next timing task based on the trigger time of the current timing task and the time slice;

[0013] When the trigger time of the next timing task arrives, store the data of the first counter at the position pointed to by the cursor of the first array, and store the data of the second counter at the position pointed to by the cursor of the second array;

[0014] Among them, the data volumes of the first array and the second array are a predetermined number, and the cursor points to the data that entered the array earliest.

[0015] In a further embodiment of this article, calculating the total number of abnormal records and the total number of transaction records based on the number of abnormal records and the number of transaction records within the sliding window includes:

[0016] When storing the data of the first counter at the position pointed to by the cursor of the first array, use the most recently calculated total number of abnormal records plus the data of the first counter and subtract the data at the position pointed to by the cursor in the first array to obtain the latest total number of abnormal records;

[0017] When storing the data of the second counter at the position pointed to by the cursor of the second array, use the most recently calculated total number of transaction records plus the data of the second counter and subtract the data at the position pointed to by the cursor in the second array to obtain the latest total number of transaction records.

[0018] In a further embodiment of this article, determining whether to start degradation based on the total number of abnormal records and the total number of transaction records includes:

[0019] Calculate the failure rate based on the total number of abnormal records and the total number of transaction records;

[0020] Judge whether the failure rate reaches the failure rate threshold and whether the total number of abnormal records reaches the abnormal threshold. If so, start the degradation process and turn off the switch of the call service and the timing task.

[0021] In a further embodiment of this article, the process of determining the time slice includes:

[0022] Obtain the number of abnormal records counted at each moment within a historical predetermined time period;

[0023] Calculate the adjacent duration with anomalies and the number of anomaly transactions corresponding to the adjacent duration according to the number of anomaly transactions counted at each moment within a historical predetermined time period;

[0024] Determine a time slice according to the adjacent duration and the total anomaly transaction threshold.

[0025] In a further embodiment of this document, determining a time slice according to the adjacent duration and the total anomaly transaction threshold includes:

[0026] Filter out the adjacent durations from all adjacent durations where the number of anomaly transactions corresponding to the adjacent duration is greater than or equal to the total anomaly transaction threshold;

[0027] Calculate the average value of the filtered adjacent durations, and use the calculated average value as the maximum value of the time slice.

[0028] In a further embodiment of this document, the method further includes:

[0029] Count the target quantity, where the target quantity is the number of time slices with zero consecutive anomaly transactions;

[0030] Before calculating the total anomaly transaction and the total transaction volume according to the number of anomaly transactions and the number of transaction volumes within the sliding window, it further includes:

[0031] Judge whether the target quantity is greater than a predetermined value;

[0032] If not, calculate the total anomaly transaction and the total transaction volume according to the number of anomaly transactions and the number of transaction volumes within the sliding window, and initialize the target quantity to zero;

[0033] If so, do not execute the calculation of the total anomaly transaction and the total transaction volume according to the number of anomaly transactions and the number of transaction volumes within the sliding window.

[0034] A second aspect of this document provides a trading verification automatic downgrading device, which is applied to a trading processing system and includes:

[0035] A start unit, which is used to start a timing task every time slice, and the timing task is used to count the number of anomaly transactions and the number of transaction volumes of service calls that occur during the time slice;

[0036] A calculation unit, which is used to calculate the total anomaly transaction and the total transaction volume according to the number of anomaly transactions and the number of transaction volumes within the sliding window, where the time period of the sliding window includes the most recent predetermined number of time slices;

[0037] A downgrading processing unit, which is used to judge whether to start downgrading according to the total anomaly transaction and the total transaction volume.

[0038] A third aspect of this document provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the method described in any of the foregoing embodiments is implemented.

[0039] A fourth aspect of this document provides a computer storage medium, on which a computer program is stored. When the computer program is executed by a processor of a computer device, the method described in any of the foregoing embodiments is implemented.

[0040] The automatic downgrading method and device for transaction verification provided in this document can accurately count the real abnormal traffic data within a recent time period (recently predetermined number of time slices) by summarizing the number of abnormal transactions and the number of transactions within a sliding window (recently predetermined number of time slices), obtaining the total number of abnormal transactions and the total number of transactions within the sliding window, and making a downgrading judgment based on the total number of abnormal transactions and the total number of transactions. It can well smooth out the suddenly increased abnormal traffic and the abnormal traffic across timing task check nodes, and perform service downgrading in a timely manner. At the same time, the size of the time slice can be freely adjusted, so as to flexibly control the traffic statistics fineness of different services and avoid incorrect downgrading caused by network jitter.

[0041] To make the above and other purposes, features, and advantages of this document more obvious and understandable, the following specifically enumerates preferred embodiments and, in conjunction with the accompanying drawings, makes the following detailed description. Description of the Drawings

[0042] To more clearly illustrate the technical solutions in the embodiments of this document or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of this document. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0043] Figure 1 Shows a schematic diagram of the existing network connection system architecture in the embodiments of this document;

[0044] Figure 2A Shows a schematic diagram of the number of abnormal calls to a service and the distribution of timing tasks in the embodiments of this document;

[0045] Figure 2B Shows another schematic diagram of the number of abnormal calls to a service and the distribution of timing tasks in the embodiments of this document;

[0046] Figure 2C Shows yet another schematic diagram of the number of abnormal calls to a service and the distribution of timing tasks in the embodiments of this document;

[0047] Figure 3 Shows a schematic diagram of the real-time transaction link in the embodiments of this document;

[0048] Figure 4 shows the flowchart of the transaction verification automatic downgrading method in the embodiments of this article;

[0049] Figure 5 shows the flowchart of the statistical process of the number of abnormal transactions and the number of transactions within a time slice in the embodiments of this article;

[0050] Figure 6 shows a flowchart of the downgrading analysis process in the embodiments of this article;

[0051] Figure 7 shows the flowchart of the time slice determination process in the embodiments of this article;

[0052] Figure 8 shows another flowchart of the transaction verification automatic downgrading method in the embodiments of this article;

[0053] Figure 9 shows the structural diagram of the transaction verification automatic downgrading device in the embodiments of this article;

[0054] Figure 10 shows the structural diagram of the computer device in the embodiments of this article;

[0055] Figure 11 shows the schematic diagram of the time period division in the embodiments of this article. Detailed implementation manners

[0056] Next, the technical solutions in the embodiments of this article will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of this article. Obviously, the described embodiments are only a part of the embodiments of this article, rather than all the embodiments. Based on the embodiments in this article, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the scope of protection of this article.

[0057] It should be noted that the terms "first", "second", etc. in the specification and claims of this article and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of this article described here can be implemented in an order different from those illustrated or described here. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, device, product, or equipment including a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or equipment.

[0058] This specification provides method operation steps as described in the embodiments or flow charts, but more or fewer operation steps may be included based on routine or non-creative work. The order of steps listed in the embodiments is only one way of executing the order of many steps and does not represent the only execution order. When the system or device product is executed in practice, it can be executed in the order of the method shown in the embodiments or the drawings or in parallel.

[0059] It should be noted that the automatic downgrade method and device for transaction verification in this article can be used in the financial field, and can also be used in any field other than the financial field. The application field of the automatic downgrade method and device for transaction verification in this article is not limited. Downgrade means that when the pressure on its own service increases, some measures are taken to enhance the processing capacity of its own service to ensure the continuous availability of the service. For example, non-core services are offline, or the real-time and data consistency requirements of non-core services are reduced to ensure the stability of core services. Downgrade in this article means that when an abnormality occurs in the call service to the transaction verification system, the call to the transaction verification system is promptly closed to ensure the stable operation of the transaction processing service.

[0060] In the prior art, a scheduled task is started at a fixed time interval, and the scheduled task performs traffic statistics and degradation judgment. Through studying the prior art, it is found that the existing degradation judgment logic has the following defects:

[0061] (1) It is impossible to take into account both rapid bleeding control and smooth sudden abnormalities. Specifically, if the scheduled task time is long, the abnormality may not be discovered in time, and the purpose of rapid bleeding control cannot be achieved, resulting in transaction damage. If the scheduled task time is short, the threshold of the number of abnormal transactions within the scheduled task time period will become very low. When encountering a system call timeout abnormality caused by short-term network jitter, more abnormalities may be generated in a short period of time, causing the threshold to be reached suddenly and leading to degradation. Figure 2A As shown in the figure, when the scheduled task time is set to 1 minute and the threshold of the number of abnormal records is 60, if the abnormality occurs after the last scheduled task check, it will not be discovered until the next scheduled task check. Therefore, it takes up to 1 minute to trigger the downgrade operation, and the bleeding cannot be stopped in time. Figure 2B As shown in the figure, when the scheduled task time is shortened to 30 seconds, the execution expectation is not met, and the threshold of the number of abnormal records needs to be reduced to 30. If 30 system timeout exceptions occur due to network jitter, even if the system has been running smoothly since then, the number of abnormal records in this minute is 30, which will still trigger downgrade. The situation of sudden abnormalities cannot be smoothed out well, which is not in line with expectations.

[0062] (2) It is impossible to detect anomalies that span inspection time nodes. Figure 2CAs shown, 30 anomalies occurred at 0:40 and another 30 anomalies occurred at 1:10. After that, the system ran smoothly. Theoretically, within the one minute from 0:30 to 1:30, the degradation threshold was also reached. However, since the system crossed the inspection period of the scheduled task, it would not be able to accumulate system anomalies and could not trigger degradation.

[0063] In one embodiment of this article, a method for automatic degradation of transaction verification is provided, which is applied to a transaction processing system and is used to solve the problem in the prior art that the abnormal degradation judgment logic when the online payment real-time transaction processing service calls the transaction verification service cannot quickly and accurately identify stable anomalies.

[0064] Specifically, as Figure 3 shown, the real-time transaction link of the transaction processing system includes: institutional front-end service, transaction processing service, transaction verification service, and bank front-end service. The transaction processing service belongs to the core system, and the transaction verification service belongs to the non-core system. It should be noted that the core system and the non-core system have different requirements or sensitivities for processing real-time performance. When the non-core system may affect the real-time performance of the core system, in order to ensure the real-time performance of the core system, the non-core system can be degraded. The institutional front-end service is used to perform pre-analysis on transaction requests and send them to the transaction processing service after passing. After receiving the transaction request, the transaction processing service first verifies whether the service call switch is turned on. If it is turned on, it calls the transaction verification service and simultaneously performs degradation analysis using the degradation processing module. If it is not turned on, it means that the verification service has been degraded, and the step of calling the transaction verification service is skipped, and the transaction request is directly processed using the transaction core processing logic before the transaction verification service is added.

[0065] As Figure 4 shown, the method for automatic degradation of transaction verification by the degradation processing module includes:

[0066] Step 401, start a scheduled task every time slice. The scheduled task is used to count the number of abnormal transaction pens and the number of transaction pens for service calls within the time slice;

[0067] Step 402, calculate the total number of abnormal transaction pens and the total number of transaction pens according to the number of abnormal transaction pens and the number of transaction pens within the sliding window, where the time period of the sliding window includes the most recent predetermined number of time slices;

[0068] Step 403, determine whether to start degradation according to the total number of abnormal transaction pens and the total number of transaction pens.

[0069] Specifically, in step 401, the time slice is a period of time, which is determined by dividing the sliding window time period by a predetermined number. In some embodiments, the sliding window time period may be a fixed time interval in the prior art, such as 1 minute, and the predetermined number can be set according to the downgrading requirements, such as 12, and the corresponding time slice is 5 seconds. In implementation, the time slice can also be determined by analyzing the historical occurrence pattern of abnormal transactions and the abnormal threshold. For the specific process, refer to the subsequent embodiments and will not be elaborated here.

[0070] The service called in step 401 refers to a non-core system. Taking the network union as an example, the service called refers to the transaction verification service. For each time slice, if no abnormality occurs in the service call within this time slice, the number of abnormal transactions is set to zero. Abnormalities that may occur in the service call include, for example, Dubbo call failures (call timeouts or abnormal operation of the called system), internal processing logic abnormalities of the system, etc. The types of abnormalities are not specifically limited in this article.

[0071] In step 402, the number of abnormal transactions and the number of transactions within the sliding window refer to the number of abnormal transactions and the number of transactions in each time slice within the sliding window. As Figure 11 shown, the sliding window includes 12 time slices, and the number of abnormal transactions and the number of transactions counted in each time slice are as Figure 11 shown in the data of each time slice in it.

[0072] When implementing step 403, it can be determined whether the number of abnormal transactions and the number of transactions within the sliding window meet their respective thresholds (that is, are greater than or equal to their respective thresholds). If so, it is determined that downgrading processing is required, that is, downgrading processing is performed on the service called in step 401. The downgrading method is, for example, to close the service. If not, no downgrading processing is required.

[0073] This embodiment can accurately count the real abnormal traffic data of abnormal service calls within the most recent time period (the most recent predetermined number of time slices), can well smooth the suddenly increased abnormal traffic and the abnormal traffic across the timing task check nodes, quickly identify the situations that need to be downgraded due to system call abnormalities, and can stop bleeding and downgrade the service in time to ensure the stability of the real-time transaction link and avoid the occurrence of an avalanche effect leading to system problems in a larger range. Regardless of the distribution of abnormal traffic within the recent time period, the value of the abnormal traffic can be accurately calculated. At the same time, the size of the time slice can be freely adjusted, so as to flexibly control the traffic statistics fineness of different services and avoid the occurrence of incorrect downgrading caused by network jitter.

[0074] In an embodiment of this article, the transaction processing service and the called service are connected through a service call switch and a bypass switch. When the service call switch is disconnected, the bypass switch is turned on. After the bypass switch is turned on, the following downgraded service recovery process is executed:

[0075] After receiving a transaction request, continue to call the service through the bypass switch, and count the number of abnormal transactions in which the service call fails and the number of transaction calls within the sliding window.

[0076] When it is detected that the number of abnormal transactions in which the service call fails and the number of transaction calls within a predetermined number of times (e.g., 3 times) of the sliding window are less than their respective thresholds, it indicates that the called service has returned to normal. Then, restart the service call switch and close the bypass switch to automatically resume the service call.

[0077] This embodiment can automatically resume the judgment of service auto - degradation after service degradation due to system anomalies, ensuring the effective progress of transactions.

[0078] Specifically, the service call switch can also be manually turned on to resume the service call.

[0079] In one embodiment of this article, the timing task is also used to count the number of rejections for which the service call feedback result is a rejected transaction within a time slice. The transaction verification auto - degradation method further includes:

[0080] According to the number of rejections within the time slice of the sliding window, count the number of rejections for each business type within the sliding window;

[0081] Based on the number of rejections for each business type within the sliding window, determine whether there is a business type with a number of rejections greater than a predetermined rejection threshold. If it is continuously determined N (N is a positive integer and can be set according to actual needs) times that the number of rejections for a certain business type is greater than the predetermined rejection threshold, then degrade the service call. At the same time, send a configuration anomaly reminder for this certain business type to relevant personnel, and the relevant personnel will check the configuration information for this certain business type according to the anomaly reminder.

[0082] This embodiment can automatically detect business anomalies and promptly degrade the service call.

[0083] In one embodiment of this article, after the service call is degraded, the following degraded service recovery process is also executed:

[0084] After receiving a transaction request, continue to call the service through the bypass switch, and count the number of rejections for each business type within the sliding window;

[0085] When it is detected that there is no business type with a number of rejections greater than the predetermined rejection threshold within a predetermined number of times (e.g., 3 times) of the sliding window, it indicates that there are no business anomalies. Then, restart the service call switch and close the bypass switch to automatically resume the service call.

[0086] This embodiment can automatically resume the judgment of service auto - degradation after service degradation due to business anomalies, ensuring the effective progress of transactions.

[0087] Of course, in specific implementation, after the business exception is excluded, the staff can manually resume the degraded service.

[0088] In one embodiment of this article, as Figure 5 shown, in step 401 above, a timing task is started every time slice. The timing task counts the number of abnormal transactions and the number of transaction pens for service calls within the time slice, including:

[0089] Step 501: Start a timing task every time slice, and initialize a first counter for storing the number of transaction pens and a second counter for storing the number of abnormal pens;

[0090] Step 502: Every time a transaction request is received, control the first counter to increment by one, and call the transaction verification service. If the call is abnormal, control the second counter to increment by one;

[0091] Step 503: Calculate the trigger time of the next timing task based on the trigger time of the current timing task and the time slice;

[0092] Step 504: When the trigger time of the next timing task arrives, store the data of the first counter at the position pointed to by the cursor of the first array, and store the data of the second counter at the position pointed to by the cursor of the second array;

[0093] Among them, the data volumes of the first array and the second array are a predetermined number, and the cursor points to the data that entered the array earliest. As Figure 11 shown, Figure 11 In the scenario shown, within 1 minute, abnormal transactions were counted in 4 time slices, with a total of 10 abnormal pens and a total of 1200 transaction pens.

[0094] Specifically, after storing data in the first array and the second array, it is also determined whether the cursor has reached the end position of the array. If it has reached the end position, the cursor is pointed to the start position of the array. If it has not reached the end position, the cursor is pointed to the next position in the data.

[0095] This embodiment records and updates data through the method of arrays and cursors, which can improve the reading efficiency of the number of abnormal pens and transaction pens within the sliding window, and thus improve the degradation processing efficiency.

[0096] In one embodiment of this article, a sequence method is used to store the number of abnormal pens and the number of transaction pens for service calls within the time slice. Specifically, when the trigger time of the next timing task arrives, the number of abnormal transaction pens and the number of transaction pens counted in each time slice are respectively recorded in the first queue and the second queue. Correspondingly, for the number of abnormal pens and transaction pens within the moving window, calculating the total number of abnormal pens and the total number of transaction pens includes:

[0097] Use a sliding window to slide and obtain the number of abnormal transactions from the first queue and slide and obtain the number of trading transactions from the second queue; sum up the number of abnormal transactions obtained from the first array to get the total number of abnormal transactions; sum up the number of trading transactions obtained from the second array to get the total number of trading transactions.

[0098] In one embodiment of the present invention, step 402 calculates the total number of abnormal transactions and the total number of trading transactions according to the number of abnormal transactions and trading transactions within the sliding window, including:

[0099] When storing the data of the first counter at the position pointed to by the cursor of the first array, use the most recently calculated total number of abnormal transactions plus the data of the first counter and subtract the data at the position pointed to by the cursor in the first array to obtain the latest total number of abnormal transactions;

[0100] When storing the data of the second counter at the position pointed to by the cursor of the second array, use the most recently calculated total number of trading transactions plus the data of the second counter and subtract the data at the position pointed to by the cursor in the second array to obtain the latest total number of trading transactions.

[0101] The most recently calculated total number of trading transactions refers to the total number of trading transactions calculated after the end of the previous time slice.

[0102] In one embodiment of the present invention, as Figure 6 shown, step 403 determines whether to initiate degradation according to the total number of abnormal transactions and the total number of trading transactions, including:

[0103] Step 601, calculate the failure rate according to the total number of abnormal transactions and the total number of trading transactions;

[0104] Step 602, determine whether the failure rate reaches the failure rate threshold and determine whether the total number of abnormal transactions reaches the abnormal threshold. If so, initiate the degradation process to close the switch of the call service and the timing task. If not, use the transaction core processing logic before the transaction verification service is added to process the transaction request.

[0105] When implementing step 601, divide the total number of abnormal transactions by the total number of trading transactions to obtain the failure rate. As Figure 11 shown, the total number of abnormal transactions is 10, and the total number of trading transactions is 1200. Therefore, the system abnormal failure rate is 1%. The failure rate threshold and the abnormal threshold in step 602 can be determined according to the degradation processing requirements, and the specific values thereof are not limited in this article.

[0106] This embodiment judges the degradation process through the sliding window related failure rate and the total number of abnormal transactions, which can refine the conditions for judging the trigger of degradation, avoid a large number of call failures in a short time caused by sudden network jitter when the traffic is large, and thus prevent the occurrence of system error degradation. Generally speaking, it can refine the system operation and maintenance judgment and more accurately implement the automatic degradation operation and maintenance operation.

[0107] In one embodiment of the present invention, as Figure 7 shown, the time slice determination process includes:

[0108] Step 701: Obtain the number of abnormal transactions counted at each moment within a historical predetermined time period;

[0109] Step 702: Calculate the adjacent abnormal duration and the corresponding number of abnormal transactions according to the number of abnormal transactions counted at each moment within the historical predetermined time period;

[0110] Step 703: Determine the time slice according to the adjacent duration and the total abnormal transaction number threshold.

[0111] Specifically, step 703 determining the time slice according to the adjacent duration and the total abnormal transaction number threshold includes:

[0112] Select the adjacent durations whose corresponding number of abnormal transactions is greater than or equal to the total abnormal transaction number threshold from all the adjacent durations;

[0113] Calculate the average value of the selected adjacent durations, and use the calculated average value as the maximum value of the time slice.

[0114] When this embodiment is implemented, each moment in steps 701 and 702 refers to each second. Specifically, in actual implementation, it can also be each unit of time, such as every 2 seconds, every 5 seconds, etc., which can be set according to actual needs.

[0115] If no adjacent duration with an abnormal transaction number greater than or equal to the total abnormal transaction number threshold can be selected in step 703, then replace the adjacent abnormal durations in step 702 with three abnormal time periods, such as Figure 11 from the first data block to the eighth data block in, and the corresponding time period is 40 seconds.

[0116] This embodiment analyzes the value range of the time slice based on historical real - time data, can reasonably determine the time slice, avoid the burden of increasing the degradation logic analysis due to a small time slice, and at the same time avoid the effect of not achieving timely degradation due to a large time slice.

[0117] In some embodiments, the time slice analyzed in this embodiment can provide a reference for designers, and designers can set the time slice according to the time slice analyzed in this embodiment and business requirements.

[0118] In some embodiments, after setting the time slice, it is also possible to collect the processing data of transaction requests, such as the transaction request processing volume and the average processing speed, and adjust the time slice according to the processing data of the transaction requests. The adjustment logic is, for example, when the transaction request processing volume and / or the average processing speed is less than the predetermined threshold, reduce the time slice; when the transaction request processing volume and the average processing speed are greater than the corresponding predetermined threshold, increase the time slice.

[0119] In one embodiment of the present invention, as Figure 8 shown, the transaction verification automatic downgrading method further includes:

[0120] Step 801: Start a timing task at each time slice. The timing task counts the number of abnormal transactions and the number of transaction calls with service exceptions within the time slice.

[0121] Step 802: Count the target quantity, where the target quantity is the number of time slices with zero consecutive abnormal transaction counts.

[0122] Step 803: Determine whether the target quantity is greater than a predetermined value.

[0123] If not, execute Step 804; if so, do not calculate the total number of abnormal transactions and the total number of transaction calls based on the number of abnormal transactions and the number of transaction calls within the sliding window.

[0124] Step 804: Calculate the total number of abnormal transactions and the total number of transaction calls based on the number of abnormal transactions and the number of transaction calls within the sliding window, and initialize the target quantity to zero.

[0125] Step 805: Determine whether to initiate downgrading based on the total number of abnormal transactions and the total number of transaction calls.

[0126] In this embodiment, by monitoring the number of consecutive time slices with zero abnormal transaction counts and determining whether to initiate downgrading judgment based on this quantity, only two steps of counting and judgment are required. Compared with Figure 6 downgrading judgment that requires calculating the failure rate and making two comparisons, it can save computing power and improve the analysis efficiency of the transaction verification automatic downgrading method.

[0127] Based on the same inventive concept, the present invention also provides a transaction verification automatic downgrading device as described in the following embodiments. Since the principle of the transaction verification automatic downgrading device for solving problems is similar to that of the transaction verification automatic downgrading method, the implementation of the transaction verification automatic downgrading device can refer to the transaction verification automatic downgrading method, and the repeated parts will not be elaborated. Specifically, as Figure 9 shown, the transaction verification automatic downgrading device is applied to a transaction processing system and includes:

[0128] A start unit 901 for starting a timing task at each time slice. The timing task counts the number of abnormal transactions and the number of transaction calls with service exceptions within the time slice.

[0129] A calculation unit 902 for calculating the total number of abnormal transactions and the total number of transaction calls based on the number of abnormal transactions and the number of transaction calls within the sliding window, where the time period of the sliding window includes the most recent predetermined number of time slices.

[0130] The downgrading processing unit 903 is configured to determine whether to initiate downgrading according to the total number of exception records and the total number of transactions.

[0131] This embodiment can accurately count the real abnormal traffic data within the most recent time period (the most recent predetermined number of time slices), can well smooth the suddenly increased abnormal traffic and the abnormal traffic across the timing task check nodes, quickly identify the situations that need to be downgraded, and can stop bleeding and perform service downgrading in a timely manner, ensuring the stability of the real-time transaction link and avoiding the occurrence of an avalanche effect leading to system problems on a larger scale. Regardless of the distribution of abnormal traffic within the recent time period, the value of the abnormal traffic can be accurately calculated. At the same time, the size of the time slice can be freely adjusted, so as to flexibly control the traffic statistics fineness of different services and avoid incorrect downgrading caused by network jitter.

[0132] In one embodiment of this article, a computer device is provided, such as Figure 10 As shown, the computer device 1002 may include one or more processors 1004, such as one or more central processing units (CPUs), and each processing unit may implement one or more hardware threads. The computer device 1002 may also include any memory 1006 for storing any kind of information such as code, settings, data, etc. Non-limiting examples include any combination of any type of RAM, any type of ROM, flash memory devices, hard disks, optical discs, etc. More generally, any memory can use any technology to store information. Further, any memory can provide volatile or non-volatile retention of information. Further, any memory may represent a fixed or removable component of the computer device 1002. In one case, when the processor 1004 executes the associated instructions stored in any memory or combination of memories, the computer device 1002 may perform any operation of the associated instructions. The computer device 1002 also includes one or more drive mechanisms 1008 for interacting with any memory, such as a hard disk drive mechanism, an optical disc drive mechanism, etc.

[0133] The computer device 1002 may further include an input / output module 1010 (I / O) for receiving various inputs (via the input device 1012) and for providing various outputs (via the output device 1014). A specific output mechanism may include a presentation device 1016 and an associated graphical user interface (GUI) 1018. In other embodiments, the input / output module 1010 (I / O), the input device 1012, and the output device 1014 may not be included, and it may only be a computer device in the network. The computer device 1002 may further include one or more network interfaces 1020 for exchanging data with other devices via one or more communication links 1022. One or more communication buses 1024 couple the components described above together.

[0134] The communication link 1022 may be implemented in any manner, for example, via a local area network, a wide area network (e.g., the Internet), a point-to-point connection, etc., or any combination thereof. The communication link 1022 may include any combination of hardwired links, wireless links, routers, gateway functions, name servers, etc. governed by any protocol or combination of protocols.

[0135] Embodiments herein also provide a computer-readable storage medium having a computer program stored thereon, and when the computer program is run by a processor, it executes the steps of the above method.

[0136] Embodiments herein also provide a computer-readable instruction, and when the processor executes the instruction, the program therein causes the processor to execute the method described in any of the foregoing embodiments.

[0137] It should be understood that in various embodiments herein, the magnitudes of the sequence numbers of the above processes do not mean the order of execution, and the order of execution of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments herein.

[0138] It should also be understood that in the embodiments herein, the term “and / or” is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent three situations: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character “ / ” herein generally represents an “or” relationship between the associated objects before and after.

[0139] Those of ordinary skill in the art can realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the composition and steps of the examples have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this article.

[0140] Those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.

[0141] In the several embodiments provided in this article, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed couplings or direct couplings or communication connections to each other can be indirect couplings or communication connections through some interfaces, devices, or units, and can also be electrical, mechanical, or other forms of connection.

[0142] The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they can be located in one place, or can be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiments in this article.

[0143] In addition, the functional units in the various embodiments of this article can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated units can be implemented in the form of hardware or in the form of software functional units.

[0144] When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution herein, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments herein. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs.

[0145] Specific embodiments are used in this article to elaborate on the principles and implementation manners of this article. The description of the above embodiments is only used to help understand the method and its core idea herein; at the same time, for those of ordinary skill in the art, according to the idea herein, there will be changes in the specific implementation manners and application scopes. In summary, the content of this specification should not be construed as a limitation to this article.

Claims

1. An automatic downgrading method for transaction verification, characterized in that, Applied to a transaction processing system, including: Starting a timing task every time slice, where the timing task is used to count the number of abnormal transactions and the number of transaction calls within the time slice when the service is called abnormally; Calculating the total number of abnormal transactions and the total number of transactions based on the number of abnormal transactions and the number of transactions within the sliding window, where the time period of the sliding window includes the most recent predetermined number of time slices; Judging whether to start degradation according to the total number of abnormal transactions and the total number of transactions.

2. The method according to claim 1, characterized in that, Starting a timing task every time slice, where the timing task counts the number of abnormal transactions and the number of transaction calls within the time slice when the service is called abnormally, including: Starting a timing task every time slice and initializing a first counter for storing the number of transactions and a second counter for storing the number of abnormal transactions; Every time a transaction request is received, controlling the first counter to increment by one and calling the transaction verification service. If the call is abnormal, controlling the second counter to increment by one; Calculating the trigger time of the next timing task according to the trigger time of the current timing task and the time slice; When the trigger time of the next timing task arrives, storing the data of the first counter at the position pointed to by the cursor of the first array, and storing the data of the second counter at the position pointed to by the cursor of the second array; Wherein, the data volumes of the first array and the second array are predetermined, and the cursor points to the data that entered the array earliest.

3. The method according to claim 2, characterized in that, Calculating the total number of abnormal transactions and the total number of transactions based on the number of abnormal transactions and the number of transactions within the sliding window includes: When storing the data of the first counter at the position pointed to by the cursor of the first array, adding the recently calculated total number of abnormal transactions to the data of the first counter and subtracting the data at the position pointed to by the cursor in the first array to obtain the latest total number of abnormal transactions; When storing the data of the second counter at the position pointed to by the cursor of the second array, adding the recently calculated total number of transactions to the data of the second counter and subtracting the data at the position pointed to by the cursor in the second array to obtain the latest total number of transactions.

4. The method according to claim 1, characterized in that, Judging whether to start degradation according to the total number of abnormal transactions and the total number of transactions, including: Calculating the failure rate according to the total number of abnormal transactions and the total number of transactions; Judging whether the failure rate reaches the failure rate threshold and judging whether the total number of abnormal transactions reaches the abnormal threshold. If so, starting the degradation process and closing the switch of the call service and the timing task.

5. The method according to claim 1, characterized in that, The process of determining the time slice includes: Obtaining the number of abnormal transactions counted at each moment within a historical predetermined time period; Calculating the adjacent duration of abnormal occurrences and the number of abnormal transactions corresponding to the adjacent duration according to the number of abnormal transactions counted at each moment within the historical predetermined time period; Determining the time slice according to the adjacent duration and the total abnormal transaction threshold.

6. The method according to claim 5, characterized in that, Determining the time slice according to the adjacent duration and the total abnormal transaction threshold includes: Filtering out the adjacent durations whose corresponding number of abnormal transactions is greater than or equal to the total abnormal transaction threshold from all the adjacent durations; Calculating the average value of the filtered adjacent durations and taking the calculated average value as the maximum value of the time slice.

7. The method according to claim 1, characterized in that, The method further includes: Counting the target quantity, where the target quantity is the number of time slices with zero consecutive abnormal transaction counts; Before calculating the total number of abnormal transactions and the total number of transactions based on the number of abnormal transactions and the number of transactions within the sliding window, it further includes: Judging whether the target quantity is greater than a predetermined value; Otherwise, calculate the total number of abnormal transactions and the total number of transactions based on the number of abnormal transactions and the number of transactions within the sliding window, and initialize the target quantity to zero; If so, do not execute the calculation of the total number of abnormal transactions and the total number of transactions based on the number of abnormal transactions and the number of transactions within the sliding window.

8. An automatic downgrading device for transaction verification, characterized in that, Applied to a transaction processing system, including: A startup unit for starting a timing task every time slice, where the timing task is used to count the number of abnormal transactions and the number of transactions for service calls within the time slice; A calculation unit for calculating the total number of abnormal transactions and the total number of transactions based on the number of abnormal transactions and the number of transactions within the sliding window, where the time period of the sliding window includes a predetermined number of recent time slices; A degradation processing unit for determining whether to initiate degradation based on the total number of abnormal transactions and the total number of transactions.

9. A computer device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method described in any one of claims 1 to 7.

10. A computer storage medium, on which a computer program is stored, characterized in that, When the computer program is executed by the processor of a computer device, it implements the method described in any one of claims 1 to 7.