Retry policy management system and retry policy management method

By designing a retry policy management system in the microservice architecture, using the combination of supervision units, scheduling units and model units, the problem of inefficiency of the existing retry mechanism is solved, and the appropriate retry strategy is automatically matched according to the exception type. Improves system stability and data availability.

CN118939476APending Publication Date: 2024-11-12DIGIWIN SOFTWARE CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410986521.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-22
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

In microservice architecture, the existing retry mechanism is inefficient and cannot be flexibly adjusted according to different scenarios, resulting in system stability and data availability being affected.

Method used

A retry policy management system is designed, including supervision unit, scheduling unit and model unit. By intercepting exception messages, identifying exception types and driving model matching operations, selecting appropriate retry policies to perform request retry, and recording retry data .

Benefits of technology

It improves the success rate and system stability of request retry, adapts to exception types in different scenarios, reduces system load, and improves overall stability and data availability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118939476A_ABST
    Figure CN118939476A_ABST
Patent Text Reader

Abstract

The invention provides a retry strategy management system and a retry strategy management method. The retry strategy management system comprises a supervision unit, a scheduling unit and a model unit. The supervision unit is used for reading the request data and the response data. The supervision unit intercepts the abnormal message, discriminates the abnormal message, records the system setting corresponding to the abnormal message, and inputs the abnormal message to the scheduling unit, so that the scheduling unit executes a retry operation. The scheduling unit drives the model unit according to the exception type corresponding to the exception message and the system setting, so that the model unit executes a model matching operation. And the scheduling unit obtains a matching retry model corresponding to the abnormal type in the plurality of retry strategy models according to a result of the model matching operation. The scheduling unit triggers the matching retry model to perform a requested retry, and records retry data requesting the retry.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a retry mechanism technology, in particular to a retry strategy management system and a retry strategy management method related to third-party service communication. Background Art

[0002] In the field of microservice architecture, how to effectively handle network communication anomalies while maintaining the stability and operation of the overall system is the direction of the industry's efforts. Since the microservice architecture involves a large number of decentralized third-party service interfaces, it is easy to encounter network anomalies such as delays, jitters, or packet loss during the request process. The existing retry mechanism retries the request data through a simple linear retry mechanism, resulting in low efficiency and the inability to flexibly adjust the strategy according to different scenarios. At the same time, too frequent retries will increase the system load and reduce system stability. Summary of the invention

[0003] The present invention is directed to a retry strategy management system and a retry strategy management method, which can automatically match appropriate retry strategies according to different scenarios to improve system stability and data availability.

[0004] According to an embodiment of the present invention, the retry strategy management system of the present invention includes a supervision unit, a scheduling unit and a model unit. The supervision unit is used to read request data and response data. The supervision unit intercepts exception messages, identifies exception messages, and records system settings corresponding to the exception messages, and inputs the exception messages into the scheduling unit so that the scheduling unit performs a retry operation. The scheduling unit drives the model unit according to the exception type corresponding to the exception message and the system settings so that the model unit performs a model matching operation. The scheduling unit obtains a matching retry model corresponding to the exception type in a plurality of retry strategy models based on the result of the model matching operation. The scheduling unit triggers the matching retry model to execute a request retry, and records the retry data of the request retry.

[0005] According to an embodiment of the present invention, the retry strategy management method of the present invention includes the following steps: the supervision unit intercepts the exception message, and inputs the exception message to the scheduling unit, so that the scheduling unit performs a retry operation; the scheduling unit drives the model unit according to the exception type corresponding to the exception message and the system setting, so that the model unit performs a model matching operation; the scheduling unit obtains a matching retry model corresponding to the exception type in multiple retry strategy models according to the result of the model matching operation; the scheduling unit triggers the matching retry model to execute a request retry, and records the retry data of the request retry.

[0006] Based on the above, the retry strategy management system and the retry strategy management method of the present invention can adaptively select a retry strategy based on the abnormal type of request data to effectively improve the success rate of request retries and system stability.

[0007] In order to make the above features and advantages of the present invention more clearly understood, embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] Figure 1 is a schematic diagram of a retry strategy management system according to an embodiment of the present invention;

[0009] Figure 2 is a flow chart of a retry strategy management method according to an embodiment of the present invention;

[0010] Figure 3 is a schematic diagram of multiple units and servers in a retry strategy management system according to an embodiment of the present invention;

[0011] Figure 4 is a flow chart of a retry strategy management method according to an embodiment of the present invention;

[0012] Figure 5 It is a linear diagram of the intelligent algorithm retry mechanism and the linear retry mechanism of the present invention.

[0013] Description of Reference Numerals

[0014] 100: retry strategy management system;

[0015] 110: Supervisory unit;

[0016] 120: dispatching unit;

[0017] 130: Model unit;

[0018] 310: Web page;

[0019] 320: server side;

[0020] 321: Server A;

[0021] 322: Server B;

[0022] 323: Server C;

[0023] 324: Server D;

[0024] 330: third-party service platform;

[0025] 331: Cloud service platform;

[0026] 332: Cloud computing platform;

[0027] 333: other servers;

[0028] 340: Supervisory unit;

[0029] 341: Configurator;

[0030] 342: Listener;

[0031] 343: recorder;

[0032] 345: Retry the governance center;

[0033] 350: dispatch unit;

[0034] 351: Retryer;

[0035] 352: Current limiter;

[0036] 353: actuator;

[0037] 360: Model unit;

[0038] 361: Fibonacci sequence algorithm;

[0039] 362: Non-uniform timing algorithm;

[0040] 363: Arithmetic series algorithm;

[0041] 364: Exponential backoff algorithm;

[0042] 365: Time Series Forecasting Retry Analysis Method;

[0043] 500: Linear chart of retry results;

[0044] S210~S250, S301~S304, S401~S418: steps. DETAILED DESCRIPTION

[0045] Reference will now be made in detail to exemplary embodiments of the present invention, examples of which are illustrated in the accompanying drawings. Whenever possible, the same reference numerals are used in the drawings and the description to refer to the same or like parts.

[0046] Figure 1 FIG. 1 is a schematic diagram of a retry strategy management system according to an embodiment of the present invention. Figure 1, the retry policy management system 100 includes a supervision unit 110, a scheduling unit 120 and a model unit 130. The supervision unit 110 is used to read request data and response data. The scheduling unit 120 is coupled to the supervision unit, and the model unit 130 is coupled to the supervision unit 110 and the scheduling unit 120. The retry policy management system 100 may also include a communication interface, a data transmission interface or a processor with actual circuit components, so that the processor executes the supervision unit 110, the scheduling unit 120 and the model unit 130 and reads, communicates or transmits data with an external server or a third-party service platform. In this embodiment, the retry policy management system 100, the web page end and the server end can be implemented, for example, on a cloud server or a private server within the enterprise, respectively.

[0047] In this embodiment, the processor of the retry strategy management system 100 may include, for example, a central processing unit (CPU), or other programmable general-purpose or special-purpose microprocessors (Microprocessors), digital signal processors (Digital Signal Processors, DSPs), application specific integrated circuits (Application Specific Integrated Circuits, ASICs), programmable logic devices (Programmable Logic Devices, PLDs), other similar processing circuits, or a combination of these devices.

[0048] The retry strategy management system 100 may also include a storage device, which may be a remote cloud storage service or a local data storage service. The storage device may include a memory and / or a database, wherein the memory may be, for example, a non-volatile memory (NVM). The storage device may store relevant programs, units, configurators, listeners, recorders, retries, current limiters, executors, modules, systems or algorithms for implementing the various embodiments of the present invention, so that the processor can access and execute the relevant functions and operations described in the various embodiments of the present invention. The storage device can be used to cache the retry data, retry records, system settings, exception types, and exception messages described in the various embodiments of the present invention. The storage device may include a database for storing the above-listed data. In addition, the exception message described in each embodiment of the present invention can be read by the listener for request data and response data, and then intercept or generate an exception message in the request data or response data. For example, the web page sends the request data to the server, and the server then sends the request data to the corresponding third-party service platform. When the web page or server sends the request data, the request data is delayed or lost. At this time, since the listener does not read the response data corresponding to the request data, the listener generates a corresponding exception message. For another example, when the server successfully sends the request data to the third-party service platform, the third-party service platform has an abnormal situation and returns the response data containing the abnormal message. At this time, the listener intercepts the abnormal message therein by reading the response data. The abnormal message may include at least one of error message information, link information, abnormal detailed data, link log, current load information, abnormal type, and abnormal time point.

[0049] Figure 2 It is a flowchart of a retry strategy management method according to an embodiment of the present invention. In step S210, the supervision unit 110 intercepts the exception message. The supervision unit 110 monitors the request link (i.e., the link layer) between the client and the third-party service platform to read the request data and the response data, and then intercepts the exception message, and retains and identifies the exception message, and records the system settings corresponding to the exception message. In step S220, the supervision unit 110 inputs the exception message to the scheduling unit 120 so that the scheduling unit 120 performs a retry operation. In step S230, the scheduling unit 120 drives the model unit 130 according to the exception type corresponding to the exception message and the system settings, so that the model unit 130 performs a model matching operation. In this embodiment, the scheduling unit 120 drives the model unit to perform a model matching operation according to the exception type in the exception message and the system settings. The exception type may be, for example, a timeout exception type, a communication exception type, an invalid gateway type, an invalid server type, a client exception type, and the like.

[0050] In step S240, the scheduling unit 120 obtains a matching retry model corresponding to the exception type in multiple retry strategy models based on the result of the model matching operation. In the present embodiment, the scheduling unit 120 obtains a matching retry model corresponding to the current exception message based on the result of the model matching operation. Multiple retry strategy models are stored in the model unit 130. In the model matching operation, the model unit 130 matches the matching retry model that best suits the current exception message from multiple retry strategy models based on the exception type in the exception message and the system settings. In step S250, the scheduling unit 120 triggers the matching retry model to execute a request retry, and records the retry data of the request retry. In this way, the scheduling unit 120 executes a request retry based on the matching retry model, and then requests a retry to the third-party service platform or server.

[0051] Figure 3 It is a schematic diagram of multiple units and servers in a retry strategy management system according to an embodiment of the present invention. Figure 4 3 is a flowchart of a retry strategy management method according to an embodiment of the present invention. The supervision unit 340 includes a listener 341, a configurator 342, and a recorder 343. The scheduling unit 350 includes a retryer 351, a current limiter 352, and an executor 353. The listener 341, the configurator 342, the recorder 343, the retryer 351, the current limiter 352, the executor 353, and the model unit 360 may be implemented in a programming language such as JSON (JavaScript Object Notation), Extensible Markup Language (XML), or YAML, but the present invention is not limited thereto.

[0052] In step S301, the web page 310 initiates a network request and then inputs the request data to the server 320. In this embodiment, the user operates the electronic device to send the request data from the web page 310 to the corresponding server in the server 320. The server 320 may include server A 321, server B 332, server C 323, and server D 324, but the present invention should not be limited to this. Next, the server corresponding to the request data in the server 320 may initiate an external request to the third-party service platform 330 through HttpClient or RestTemplate. When the corresponding service platform in the third-party service platform 330 receives the request data transmitted from the server 320, the corresponding service platform returns the response data to the server 320. The service platform included in the third-party service platform 330 may be, for example, a cloud service platform 331, a cloud service platform 332, or other servers 333, but the present invention should not be limited to this.

[0053] In step S302, the listener 342 of the supervision unit 340 monitors whether the request and response are abnormal. In this embodiment, the step of intercepting the abnormal message by the supervision unit 340 includes: the listener 342 monitors whether the request data and the response data are normal, and intercepts the abnormal message. In one embodiment, the listener 342 monitors the link layer (Data Link Layer) between the web page end 310 and the server end 320, and monitors the link layer between the server end 320 and the third-party service platform, and then reads and monitors whether the request data or the response data is normal, and then intercepts the abnormal message. The abnormal message may include at least one of error message information, link information, abnormal detailed data, link log, current load information, abnormal type, and abnormal time point. In this embodiment, after receiving the abnormal message, the listener 342 notifies the recorder 343 to record the abnormal message, and then stores the error message, link, abnormal details and other information in the database or storage device.

[0054] In step S401, the retryer 351 of the scheduling unit 350 determines whether the system is of a fixed type according to the system setting of the system corresponding to the exception message. The system setting may include a fixed type and a non-fixed type. When the system setting is a fixed type, the model unit selects a matching retry model corresponding to the fixed type from a plurality of retry strategy models. When the system setting is a fixed type, the retry strategy representing the request data issued by the service system is suitable for a customized fixed model. For example, when the user pre-sets the current service system to be a high availability service system, the suitable customized fixed model may be a Fibonacci series model. When the user pre-sets the current service system to be a stability service system, the customized fixed model suitable for the current exception message may be a non-arithmetic timing model or an exponential backoff model.

[0055] In step S402, the configurator 341 of the supervision unit 340 obtains information such as tenant information and user authority information, and stores the obtained information in the database or the configurator 341. In step S403, the configurator 341 reads whether the request type is a retryable type. In this embodiment, the configurator 341 determines whether the restful request is an idempotent configuration and records the judgment result in a log or a database, and the configurator 341 marks the retryable application program interface (API) in the server side 320 as idempotent and stores it in the configurator 341. In this embodiment, the configurator 341 reads the request type corresponding to the exception message to determine whether the request type is a retryable request type. The retryable request type may be, for example, a GET request or a GET request to a trusted third-party service platform (for example, through a third-party application program interface).

[0056] In step S404 and step S405, when the listener 342 listens to the request and receives an exception message, the listener 342 obtains the user permission API corresponding to the exception message and the HTTP status code of the exception from the configurator 341 or the recorder 343. In this embodiment, the exception type corresponding to the exception message can be determined through the HTTP status code, for example, the HTTP 502 status code represents an invalid gateway, and the HTTP 504 status code represents a gateway timeout, but the present case should not be limited to this.

[0057] In step S406, the recorder 343 stores the exception message. In one embodiment, the recorder 343 stores the exception message in a database. In steps S407 and S408, the retryer 351 of the scheduling unit 350 calls the retryer mechanism according to the exception message. In one embodiment, when the exception type corresponding to the current exception message has not completed the retry of each retry strategy, the retryer initiates the retry strategy that has not been completed according to the retry record. In one embodiment, the model unit 360 performs a model matching operation to obtain a retry strategy algorithm corresponding to the exception type in multiple retry strategies, including: the retryer 351 performs a model matching operation according to the exception type of the exception message and the corresponding retry record, and then selects a matching retry model from multiple retry strategy models. In another embodiment, when the exception message of the same exception type is retried by each retry strategy, the system then executes step S411. In addition, the retryer 351 of the scheduling unit 350 initiates a retry and records relevant information related to the retry, and the relevant information may include information such as retry records, retry factors, and exception types.

[0058] In step S409, the retryer 351 polls each retry strategy model according to the exception type corresponding to the exception message. In other words, the retryer 351 of the scheduling unit 350 matches the exception messages with the same exception type to multiple retry strategy models one by one. In this embodiment, the multiple retry strategy models stored in the model unit 360 include: Fibonacci series model, non-arithmetic time series model, arithmetic series model, exponential backoff model and time series prediction retry analysis model.

[0059] The retry interval of the Fibonacci sequence model is related to the Fibonacci sequence algorithm 361. The Fibonacci sequence model uses the Fibonacci sequence algorithm and the golden section recursion, and its sequence algorithm is: F(1) = 1; when n>1, F(n) = F(n-1) + F(n-2), F is a function, and n is a positive integer. The unit of the retry interval is seconds, so the Fibonacci sequence can be used to obtain a sequence of retry intervals of 1, 1, 2, 3, 5.8, 13, 21, 34... respectively. The Fibonacci sequence model used in this system can solve the retry of abnormal messages in a shorter time based on the stability of the system, such as network interruption or server overload. In other words, it is suitable for instantaneous problems and can restore the operation of the service system in a shorter time.

[0060] The retry interval of the non-arithmetic timing model is related to the sequence of natural numbers to the power of N plus N, where N is a positive integer and N represents the number of retries. The sequence used for the retry interval of the non-arithmetic timing model is 1 second for the first time, and the retry interval after the second time is the Nth power of the concession factor plus N. N is a positive integer that increases by one each time, N for the second retry is 1, and the maximum value of the retry interval is 120. In this embodiment, the concession factor is a preset fixed value, for example, the concession factor is 2, so that the retry interval of the non-arithmetic timing model is: 1, 3, 6, 11...120. The non-arithmetic timing algorithm 362 of the non-arithmetic timing model used in this system helps to reduce the server load, giving the server more time to recover to a usable stable state during the initial retry, thereby reducing meaningless requests, and is therefore applicable to situations where the problem resolution time is uncertain, or the server (or service system) is in a continuous overload state.

[0061] The retry interval of the arithmetic progression model is related to the arithmetic progression algorithm 363 with a tolerance of a natural number. In one embodiment, the sequence used for the retry interval of the arithmetic progression model is that the first retry time is 1 second, the tolerance is 2, and the maximum yield time is 120 seconds. So set, the second and subsequent yield time: 3, 5, 7, 9 ... 120. The arithmetic progression model adopted by this system is through a fixed time network retry mechanism to ensure that data arrives in time, and then reduces the data loss caused by anomalies. Therefore, the arithmetic progression model is applicable to real-time communication that must ensure low latency, or a scene with high network fault tolerance requirements.

[0062] The retry waiting time of the exponential backoff model is related to the exponential backoff algorithm. The exponential backoff algorithm is: the backoff time is equal to the random number multiplied by the unit time interval and then multiplied by the square of the number of retransmissions of 2, that is, the random number * unit time interval * 2^(number of retransmissions), and the number of retransmissions is the number of retries of the same request data. In this embodiment, the unit time interval is 1 second, the number of retransmissions is the number of retries, the maximum backoff time (i.e., the retry waiting time) is 120 seconds, and the random number is a random number between 1 and 5. For example, when the random number is 3, the algorithm for the retry interval time of the second request retry is 3 (random number) * 1 (unit time interval) * 2^2 (number of retransmissions), which is equal to 12 seconds. The exponential backoff model adopted by this system uses jitter (through random numbers) to prevent continuous conflicts, thereby dispersing the sending time of retry requests (i.e., retries to resend request data). Therefore, the exponential backoff model is suitable for scenarios where the system is set to a stable type, or where competition for request retries needs to be gradually reduced. That is, when multiple clients retry requests simultaneously, exponential backoff can reduce the concentration of requests and thus reduce the server load.

[0063] The time series prediction retry analysis model is related to the difference autoregressive moving average model. Specifically, the algorithm in the time series prediction retry analysis model is to use the autoregressive moving average model ARIMA (p, d, q), which consists of three parts, namely, autoregressive (AR), difference (I, i.e., integration) and moving average (MA) models, and then the autoregressive moving average model is used based on the date cycle dimension to identify the order autocorrelation diagram (ACF) and partial autocorrelation diagram (PACF) and adaptability test to predict the current retry response mechanism. In this embodiment, when the request data of the same abnormal type is abnormal again, the model unit 360 is based on the retry records of the previous four times with the same abnormal type (i.e., the request retries of the Fibonacci sequence model, the non-arithmetic time series model, the arithmetic progression model, and the exponential backoff model are performed respectively), and then simulated based on the historical time / records through the above-mentioned difference autoregressive moving average model to generate a retry scheme suitable for the current abnormal message (including the maximum number of retries and the retry interval time). Next, the retryer 351 performs the fifth retry of the exception type according to the retry scheme, and calculates and records its retry factor.

[0064] The time series prediction retry analysis model adopted by the system can cope with the system failure caused by external factors such as seasonal changes and high concurrency through the characteristics of the ARIMA model, so as to effectively improve the retry success rate. In one embodiment, the model unit 360 establishes a time series prediction retry analysis model based on the retry data. In this way, the step of the model unit performing the model matching operation also includes: the model unit 360 obtains the retry strategy information based on the retry data, the abnormal message and the retry record through the established time series prediction retry analysis model, and the retry strategy information includes the number of retries and the retry time. In this way, the model unit 360 uses the time series prediction retry analysis model for the fifth retry matching of the abnormal information of the same abnormal type, and outputs the above retry strategy information to enable the retryer 351 to perform data retry according to the number of retries and the retry time in the retry strategy information.

[0065] The model unit 360 also includes a data cleaning model, and performs a data cleaning operation on the retry data, historical retry model data, abnormal messages, and retry records through the data cleaning model to generate cleaned data. The data cleaning operation is an operation such as data preprocessing and cleaning outliers. In one embodiment, the model unit 360 establishes a time series prediction retry analysis model based on the cleaned data through a differential autoregressive moving average model. In step S410, after the executor 353 executes the request retry according to the matching retry model, the retry factor is calculated according to the retry data and the formula, and the retry result includes the number of retries and the retry time.

[0066] The executor 353 calculates the retry factor according to the retry data and stores the retry factor in the retry record. The retry factor is related to the quotient of the coefficient of variation and the retry frequency, and the coefficient of variation is related to the memory efficiency ratio, the CPU usage rate, the number of retries and the retry time. The retry frequency is related to the number of times the model is used, the current model usage time point and the first time the model is used. In one embodiment, the coefficient of variation can be calculated by the following formula: g = M*C+N*S, g is the coefficient of variation, M is the system's memory efficiency ratio, C is the CPU usage rate (i.e., CPU share), N is the number of retries, and S is the retry time. The number of retries is the number of times the system initiates a request retry after an exception occurs in the request service. The retry time is the total time consumed by the system to initiate a request retry after an exception occurs in the request service. The retry frequency can be calculated by the following formula: e = N / T, e is the retry frequency, N is the number of times the model is used, and T is the time difference between the current and first use. When the model is used for the first time, the retry frequency is 1. Specifically, the model usage times N is the number of times the model is used by the model unit 360. The current and first usage time difference T is the time difference between the current time (seconds) of using the model and the first usage time (seconds). Next, the quotient of the coefficient of variation divided by the retry frequency is the retry factor of the currently used retry strategy model corresponding to the exception type.

[0067] For example, the supervision unit 340 obtains an exception message, and the exception type corresponding to the exception message is a 503 error, and the cause is that the order server is restarting the service, which causes the client to obtain the customer's order data and then call the API of the order server, resulting in the above-mentioned 503 error. When the scheduling unit 350 performs the first retry of this exception type, it will first initiate the retry operation of the Fibonacci sequence model. In this example, the retry operation using the Fibonacci sequence model is accessed after the fourth retry, and the retry takes 7 seconds. The memory usage during the 7 seconds is 17MB / 254MB, the CPU usage is 3% / 20%, and the link data definition language (DDL) of the current API is recorded, the number of model adoptions, the model adoption time, the retry status code 503, the retry time, and the number of retries. In this example, the retry factor of the Fibonacci model is (17 / 254)*(3% / 20%)+4*7 / 1=28.0159.

[0068] The next time the scheduling unit 350 receives an exception message with an exception type of 503, the scheduling unit 350 uses the non-arithmetic timing model, the arithmetic series model, the exponential backoff model, and the time series prediction retry model in sequence, and then according to the above rules, if the API encounters a 503 exception, after going through the five retry strategy models, it obtains the matching retry model with the lowest retry factor.

[0069] In step S411, after five pollings (i.e., each retry strategy model is executed once), the retryer 351 captures the retry model with the smallest retry factor (i.e., the retry strategy model). In addition, the retryer 351 stores the retry strategy model with the smallest retry factor corresponding to the exception type in the retry record. With such a setting, when there is an exception message of the same exception type to be retried next time, the executor 353 can directly use the retry strategy model with the smallest retry factor in the retry record as the matching retry model. In other words, the retryer 351 calculates multiple retry factors corresponding to each retry strategy model according to the retry data, and uses the model with the smallest retry factor from the multiple retry strategy models as the matching retry model. With such a setting, the next time the supervisory unit intercepts an exception message of the same exception type, the scheduling unit 350 can directly use the matching retry model to perform the retry operation of the exception message. The retryer 351 stores the matched retry strategy model of the current exception type as retry data in a database or storage device.

[0070] In step S412, the executor 353 reads the retry factor in the retry record and intelligently selects the corresponding model. Specifically, the executor 353 selects the retry strategy model with the smallest retry factor as the matching retry model based on the historical retry records of the corresponding exception type. In step S303 and step S413, the model unit 360 feeds back the adopted model algorithm to drive the executor 353 to initiate a retry. In this way, in step S304, the executor 353 is used to initiate a request retry according to the matching retry model and record the retry data in the retry operation.

[0071] In one embodiment, the model unit 360 also stores a fuse degradation model. The fuse degradation model adopts a fuse degradation safety protection model. In step S414, the model unit 360 controls the stability of the system service through the fuse mechanism model. Specifically, the model unit 360 selects a suitable policy model according to the system requirements and performance requirements, and thus determines the stability and performance of the current service architecture through the current service load situation and makes a retry mark, and then reasonably allocates resources through parallel and distributed computing algorithms. In other words, the model unit 360 may consider effectively allocating tasks on multiple processors or machines to reduce computing time and improve efficiency, provide an overload protection mechanism and a current limiting mechanism to control the frequency of retries, and then calculate the retry model / retry strategy currently suitable for the system.

[0072] In this embodiment, when one of the CPU usage and memory usage of the running system reaches a set value, the model unit 360 triggers the fuse degradation model to make the current limiter of the scheduling unit 350 perform a current limiting truncation operation and update the retry data. Specifically, the listener 341 of the supervision unit 340 reads the CPU usage and memory usage of the running system, and the recorder 343 of the supervision unit 340 stores the CPU usage and memory usage in the database.

[0073] In step S415, when the resource ratio of the operating system (for example, one of the processor usage ratio and the memory ratio) reaches 65%, the current limiter 352 actively cuts off the retry operation and records the records and data related to the cut-off. Then, in step S416, the retry operation is terminated and the retry operation is recorded as a retry failure. The recorded code may be, for example, 504, 502, 503, etc., but the present case should not be limited to this.

[0074] In another embodiment, in step S417, the resource ratio of the operating system does not reach 65%, so the model unit 360 does not trigger the fuse degradation model. In this embodiment, the retry result after the retry is successful, and the executor 353 can record the result of the successful retry as code 200. In step S418, the resource ratio of the operating system does not reach 65%. Therefore, the model unit 360 does not trigger the fuse degradation model, and the retry result in step S418 is a retry failure. The executor 353 uses the result of the retry failure as a retry record and records it in a database or storage device. The retry failure code recorded by the executor 353 can be, for example, 504, 502, 503, etc., and the present case should not be limited to this.

[0075] Figure 5 It is a linear diagram of the intelligent algorithm retry mechanism and the linear retry mechanism of the present invention. Figure 5 As shown in the figure, based on the number of retries and the retry success rate of the ordinary linear retry strategy, it can be seen that the retry performance of the ordinary linear retry strategy is significantly lower than that of the intelligent algorithm retry. The intelligent algorithm retry uses this system to perform different retry strategy models one by one according to different exception types, and calculates the retry factor based on the retry data and retry records, and then selects the retry strategy model suitable for the corresponding exception type.

[0076] In summary, the retry strategy management system and the retry strategy management method use the client and server request states as a bridge, and monitor the abnormal events (i.e., abnormal messages) of the supervision unit 340, and then initiate the scheduling unit 350 to select a suitable retry strategy model based on the system settings or based on the retry records, so as to achieve system stability and retry effectiveness. The system provides an intelligent retry method based on multiple algorithm models, which can automatically match the appropriate retry strategy according to different scenarios (such as abnormal types) to improve system stability and data availability.

[0077] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A retry strategy management system, characterized in that: include: A supervisory unit, used to read request data and response data; A scheduling unit, coupled to the supervision unit; as well as A model unit, coupled to the supervision unit and the scheduling unit, The monitoring unit intercepts the abnormal message, identifies the abnormal message, and records the system setting corresponding to the abnormal message, and then inputs the abnormal message to the scheduling unit so that the scheduling unit performs a retry operation. wherein the scheduling unit drives the model unit according to the exception type corresponding to the exception message and the system setting, so that the model unit performs a model matching operation, The scheduling unit obtains a matching retry model corresponding to the exception type from a plurality of retry strategy models according to the result of the model matching operation, The scheduling unit triggers the matching retry model to execute a request retry, and records retry data of the request retry.

2. The retry strategy management system according to claim 1, characterized in that: The scheduling unit includes a retryer and an executor. wherein the retryer performs the model matching operation according to the exception type of the exception message and the corresponding retry record, and then selects the matching retry model from the multiple retry strategy models, wherein the executor is used to initiate the request retry according to the matching retry model and record the retry data, wherein the executor calculates a retry factor according to the retry data and stores the retry factor in the retry record, When the system is set to a fixed type, the model unit selects the matching retry model corresponding to the fixed type from the multiple retry strategy models.

3. The retry strategy management system according to claim 1, characterized in that: The supervision unit includes a listener, a configurator and a recorder. The listener monitors whether the request data and the response data are normal, and intercepts the abnormal message. The configurator reads the request type corresponding to the exception message to determine whether the request type is a retryable request type. The recorder stores the abnormal message.

4. The retry strategy management system according to claim 3, characterized in that: The abnormal message includes at least one of error message information, link information, abnormal detailed data, link log, current load information, the abnormal type, and abnormal time point.

5. The retry strategy management system according to claim 1, characterized in that: The multiple retry strategy models include a Fibonacci sequence model, a non-arithmetic time series model, an arithmetic series model, an exponential backoff model, and a time series prediction retry analysis model. The retry interval of the Fibonacci sequence model is related to the Fibonacci sequence algorithm. The retry interval of the non-uniform time series model is related to the sequence of natural numbers to the power of N plus N, where N is the number of retries. The retry interval of the arithmetic progression model is related to the arithmetic progression algorithm with a common difference of natural numbers. The retry waiting time of the exponential backoff model is related to the exponential backoff algorithm. The time series forecast retry analysis model is related to the difference autoregressive moving average model, wherein the time series forecast retry analysis model is related to the difference autoregressive moving average model.

6. The retry strategy management system according to claim 5, characterized in that: The retryer of the scheduling unit matches the exception messages having the same exception type to the multiple retry strategy models one by one, wherein the model unit establishes the time series prediction retry analysis model according to the retry data, The retryer calculates a plurality of retry factors according to the retry data, and uses a model having a minimum retry factor from among the plurality of retry strategy models as the matching retry model.

7. The retry strategy management system according to claim 6, characterized in that: The retry factor is related to the quotient of the coefficient of variation and the retry frequency, wherein the coefficient of variation is related to the memory efficiency ratio, the CPU usage rate, the number of retries and the retry time, wherein the retry frequency is related to the number of model usages, the current model usage time point and the model first usage time point.

8. The retry strategy management system according to claim 6, characterized in that: The model unit performs a data cleaning operation on the retry data, the historical retry model data, the abnormal message and the retry record through a data cleaning model to generate cleaned data. The model unit establishes the time series prediction retry analysis model based on the cleaned data through the differential autoregressive moving average model. The time series prediction retry analysis model obtains retry strategy information according to the retry data, the abnormal message and the retry record, and the retry strategy information includes the number of retries and the retry time.

9. The retry strategy management system according to claim 6, characterized in that: The model unit also stores a fuse degradation model. When one of the CPU usage rate and memory usage of the running system reaches a set value, the model unit triggers the fuse degradation model to enable the current limiter of the scheduling unit to perform a current limiting truncation operation and update the retry data.

10. The retry strategy management system according to claim 9, characterized in that: The monitor of the monitoring unit reads the CPU usage rate and the memory share of the running system, and the recorder of the monitoring unit stores the CPU usage rate and the memory share in a database.

11. A retry strategy management method, characterized in that: include: Intercept abnormal messages through the supervision unit; Identifying the abnormal message through the supervision unit, recording the system setting corresponding to the abnormal message, and inputting the abnormal message into the scheduling unit so that the scheduling unit performs a retry operation; The scheduling unit drives the model unit according to the exception type corresponding to the exception message and the system setting, so that the model unit performs a model matching operation; Obtaining, by the scheduling unit, a matching retry model corresponding to the exception type in a plurality of retry strategy models according to a result of the model matching operation; as well as The matching retry model is triggered by the scheduling unit to execute a request retry, and retry data of the request retry is recorded.

12. The method according to claim 11, characterized in that The step of the model unit performing a model matching operation to obtain a retry strategy algorithm corresponding to the exception type in a plurality of retry strategies comprises: The retryer performs the model matching operation according to the exception type of the exception message and the corresponding retry record, and then selects the matching retry model from the multiple retry strategy models. The executor is used to initiate the request retry according to the matching retry model and record the retry data, The retry strategy management method further includes: The executor calculates a retry factor according to the retry data, and stores the retry factor in the retry record. The step of the model unit performing the model matching operation comprises: When the system is set to a fixed type, the matching retry model corresponding to the fixed type is selected from the multiple retry strategy models by the model unit.

13. The method according to claim 11, characterized in that The step of intercepting abnormal messages by the supervision unit includes: Monitor request data and response data to see if they are normal through a listener, and intercept the abnormal message; Reading the request type corresponding to the exception message through the configurator to determine whether the request type is a retryable request type; and The exception message is stored in a logger.

14. The method according to claim 13, characterized in that: The abnormal message includes at least one of error message information, link information, abnormal detailed data, link log, current load information, the abnormal type, and abnormal time point.

15. The method according to claim 11, characterized in that The multiple retry strategy models include a Fibonacci sequence model, a non-arithmetic time series model, an arithmetic series model, an exponential backoff model, and a time series prediction retry analysis model. The retry interval of the Fibonacci sequence model is related to the Fibonacci sequence algorithm. The retry interval of the non-uniform time series model is related to the sequence of natural numbers to the power of N plus N, where N is the number of retries. The retry interval of the arithmetic progression model is related to the arithmetic progression algorithm with a common difference of natural numbers. The retry waiting time of the exponential backoff model is related to the exponential backoff algorithm. The time series forecast retry analysis model is related to the difference autoregressive moving average model, wherein the time series forecast retry analysis model is related to the difference autoregressive moving average model.

16. The method according to claim 15, characterized in that The steps to perform a model matching operation include: Matching the exception messages having the same exception type to the multiple retry strategy models one by one through the retryer of the scheduling unit; Establishing the time series prediction retry analysis model according to the retry data by the model unit; and The retryer calculates a plurality of retry factors according to the retry data, and uses a model having a minimum retry factor from among the plurality of retry strategy models as the matching retry model.

17. The method according to claim 16, characterized in that The retry factor is related to the quotient of the coefficient of variation and the retry frequency, wherein the coefficient of variation is related to the memory efficiency ratio, the CPU usage rate, the number of retries and the retry time, wherein the retry frequency is related to the number of model usages, the current model usage time point and the model first usage time point.

18. The method according to claim 16, characterized in that The steps of establishing the time series prediction retry analysis model include: Performing data cleansing operations on the retry data, the historical retry model data, the exception message, and the retry record based on the data cleansing model by the model unit to generate cleansed data; and The time series prediction retry analysis model is established by the model unit according to the cleaned data through the differential autoregressive moving average model, The step of the model unit performing the model matching operation further includes: The time series prediction retry analysis model obtains retry strategy information according to the retry data, the abnormal message and the retry record, and the retry strategy information includes the number of retries and the retry time.

19. The method according to claim 16, characterized in that The model unit also stores a fuse degradation model. The retry strategy management method further includes: When one of the CPU usage rate and memory usage of the running system reaches a set value, the fuse degradation model is triggered by the model unit to enable the current limiter of the scheduling unit to perform a current limiting truncation operation and update the retry data.

20. The method according to claim 19, characterized in that The retry strategy management method also includes: Reading the CPU usage and the memory share of the running system through the monitor of the monitoring unit; and The CPU usage rate and the memory share are stored in a database through the recorder of the supervisory unit.

Citation Information

Cited By

  • Conflict optimization method and apparatus, and communication device

    CN120730033A