Third-party service management method, device, equipment and computer-readable storage medium

Through real-time data statistics and exponential weighted moving average method model, the problem of low efficiency of third-party service management under traditional monitoring methods is solved, timely management and downgrade processing is achieved, and user experience and operational efficiency is improved.

CN111444069BActive Publication Date: 2025-04-08CHINA PING AN LIFE INSURANCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010142332.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-03-04
Publication Date
2025-04-08
Estimated Expiration
2040-03-04

AI Technical Summary

Technical Problem

Traditional monitoring methods are difficult to detect third-party service problems in a timely manner, resulting in poor user experience and high operating costs, and inefficient existing management.

Method used

Through the data collection system, the number of calls of third-party services and the number of callers is counted in real time, the exponential weighted moving average method model is used to fit the data, predict the number of calls, and manage services through the deviation rate, including service downgrade and switching providers.

Benefits of technology

It realizes timely management of third-party services, improves management efficiency and accuracy, and reduces operating costs and user impact.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111444069B_ABST
    Figure CN111444069B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of artificial intelligence, and discloses a third-party service management method, including: collecting and counting the number of calls and the number of callers of a third-party service in real time, obtaining statistical data, and storing the statistical data in a real-time distributed storage system HBase; fitting the statistical data in the real-time distributed storage system HBase through an exponentially weighted moving average model to obtain a relationship function, and predicting the predicted number of calls E of the third-party service at time t based on the relationship function and the statistical data; monitoring and obtaining the actual number of calls S1 of the third-party service at time t; calculating the deviation rate P between S1 and E; and managing the current third-party service based on the size relationship between the deviation rate P and a preset experience value. The present invention also discloses a third-party service management device, equipment, and computer-readable storage medium, which improves the management efficiency of third-party services.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a third-party service management method, device, equipment and computer-readable storage medium. Background Art

[0002] Traditional monitoring methods often rely on feedback results to count and judge whether the service is available. However, in the actual project process, due to various reasons, third-party services cannot timely feedback the call results, or there is a long delay in feedback. For example, for SMS sending services, due to the delay in receiving SMS, third-party operators cannot timely feedback the results. In this case, for such third-party services without feedback, if there is a problem, it is difficult to find it in time with traditional monitoring methods. It can only rely on user reports or regular inquiries to find it, which is easy to cause a poor experience for users. Users feedback to the customer service center, which puts pressure on the customer service center and occupies precious customer service resources. The operating costs will also increase or decrease accordingly. Therefore, the existing processing method is inefficient in managing third-party services. Summary of the invention

[0003] The main purpose of the present invention is to provide a third-party service management method, device, equipment and computer-readable storage medium, aiming to solve the technical problem of low efficiency of third-party service management.

[0004] To achieve the above object, the present invention provides a third-party service management method, which comprises the following steps:

[0005] The data collection system Flume collects and counts the number of calls and the number of callers of the third-party service in real time to obtain statistical data, and stores the statistical data in the record table real-time distributed storage system HBase;

[0006] Fitting the statistical data in the real-time distributed storage system HBase through an exponentially weighted moving average model to obtain a relationship function, and predicting the predicted number of calls E of the third-party service at time t based on the relationship function and the statistical data;

[0007] Monitor and obtain the actual number of calls S of the third-party service at time t 1 ;

[0008] The S is calculated by the preset formula 1 and the deviation rate P between E, and based on the relationship between the deviation rate P and the preset experience value, managing the current third-party service, wherein the management includes: service degradation processing and switching service providers.

[0009] Optionally, before fitting the statistical data in the real-time distributed storage system HBase by an exponentially weighted moving average model to obtain a relationship function, and predicting the predicted number of calls E of the third-party service at time t based on the relationship function and the statistical data, the method further includes:

[0010] According to the preset training times, the initial exponentially weighted moving average method model is trained using the preset first training sample set, and an initial prediction value is obtained;

[0011] Determine whether the accuracy of the initial prediction value is greater than or equal to the preset accuracy according to the preset actual value;

[0012] If the accuracy of the initial prediction value is greater than or equal to the preset accuracy, an exponentially weighted moving average method model is obtained;

[0013] If the accuracy of the initial prediction value is less than the preset accuracy, the initial exponentially weighted moving average model is trained according to the exhaustive method until the accuracy of the initial prediction value is greater than or equal to the preset accuracy, thereby obtaining an exponentially weighted moving average model.

[0014] Optionally, fitting the statistical data in the real-time distributed storage system HBase by an exponentially weighted moving average model to obtain a relationship function, and predicting the predicted number of calls E of the third-party service at time t based on the relationship function and the statistical data, comprises the following steps:

[0015] Determine whether the statistical data in the real-time distributed storage system HBase is within a preset time;

[0016] If the statistical data in the real-time distributed storage system HBase is within a preset time, the statistical data is fitted by an exponentially weighted moving average model to obtain a relationship function between the number of calls to the third-party service and the number of callers, wherein the relationship function is expressed as follows:

[0017]

[0018] After iteration, the predicted value S at time t is obtained t , which can be expressed as:

[0019] S t =α[Y t-1 +(1-α)Y t-2 +(1-α) 2 Y t-3 ……+(1-α) k Y t-(k+1) ]+(1-α) k+1 S t-(k+1)

[0020] Among them, S t is the predicted value at time t, Y t is the true value at time t, α is the weight coefficient of the exponentially weighted moving average model for statistical data, 0<α<1;

[0021] Let β = 1-α to get the predicted number of calls E of the third-party service, where

[0022]

[0023] Optionally, the S is calculated by a preset formula 1 The deviation rate P between the E and the E, and based on the relationship between the deviation rate P and the preset experience value, the current third-party service is managed, the management includes: service degradation processing and switching service providers, including:

[0024] The S is calculated by the following formula 1 The deviation rate P between E and

[0025]

[0026] Determine whether the deviation rate P is greater than or equal to the first preset experience value F 1 ;

[0027] If the deviation rate P is greater than or equal to the first preset empirical value F 1 , then manage the current third-party service, including: service degradation processing and switching service providers.

[0028] Optionally, if the deviation rate P is greater than or equal to a first preset empirical value F 1 , then manage the current third-party service, the management includes: service degradation processing and switching service providers include:

[0029] If the deviation rate P is greater than or equal to F 1 , then determine whether the deviation rate P is less than or equal to the second preset empirical value F 2 ;

[0030] If the deviation rate P is less than or equal to the second preset empirical value F 2 , the call service weight of the current third-party service is lowered through the downgrade component hystrix of the spring framework;

[0031] If the deviation rate P is greater than the second preset empirical value F 2 , the call service weight of the current third-party service is adjusted to 0 through the downgrade component hystrix of the spring framework.

[0032] Optionally, before fitting the statistical data in the real-time distributed storage system HBase by an exponentially weighted moving average model to obtain a relationship function, and predicting the predicted number of calls E of the third-party service at time t based on the relationship function and the statistical data, the method further includes:

[0033] Determining whether the storage time of the statistical data in the record exceeds a preset time period;

[0034] If the storage time of the statistical data in the record exceeds the preset time period, the steps of collecting and counting the number of calls and the number of callers of the third-party service in real time to obtain statistical data, and storing the statistical data in the real-time distributed storage system HBase are performed;

[0035] If the storage time of the statistical data in the record does not exceed the preset time period, the step of fitting the statistical data in the real-time distributed storage system HBase through the exponentially weighted moving average model is executed to obtain the relationship function, and the predicted number of calls E of the third-party service at time t is predicted based on the relationship function and the statistical data.

[0036] Optionally, in the step of calculating the S by a preset formula 1 and the deviation rate P between E and the preset experience value, and managing the current third-party service based on the size relationship between the deviation rate P and the preset experience value, the management including: after service degradation processing and switching service providers, also including:

[0037] Determine if there is a third-party service with delayed feedback;

[0038] If there is a third-party service with delayed feedback, the call service weight of the third-party service can be reduced through the spring framework's downgrade component hystrix.

[0039] Furthermore, to achieve the above object, the present invention also provides a third-party service management device, which includes the following modules:

[0040] The statistical data storage module is used to collect and count the number of calls and the number of callers of the third-party service in real time through the data collection system Flume, obtain statistical data, and store the statistical data in the record table real-time distributed storage system HBase;

[0041] A third-party service call count prediction module is used to fit the statistical data in the real-time distributed storage system HBase through an exponentially weighted moving average model to obtain a relationship function, and predict the predicted call count E of the third-party service at time t based on the relationship function and the statistical data;

[0042] The monitoring module is used to monitor and obtain the actual number of calls S of the third-party service at the time t. 1 ;

[0043] The third-party service management module is used to calculate the S 1 and the deviation rate P between E, and based on the relationship between the deviation rate P and the preset experience value, managing the current third-party service, wherein the management includes: service degradation processing and switching service providers.

[0044] Optionally, the third-party service management device further includes:

[0045] A training module, used to train the initial exponentially weighted moving average method model according to a preset number of training times using a preset first training sample set, and obtain an initial prediction value;

[0046] An accuracy judgment module, used to judge whether the accuracy of the initial prediction value is greater than or equal to a preset accuracy according to a preset actual value;

[0047] An exponentially weighted moving average method model acquisition module, used to obtain an exponentially weighted moving average method model if the accuracy of the initial prediction value is greater than or equal to a preset accuracy;

[0048] The initial exponentially weighted moving average model continues to train the model according to the exhaustive method if the accuracy of the initial prediction value is less than the preset accuracy, so as to obtain the exponentially weighted moving average model.

[0049] Optionally, the third-party service call count prediction module includes:

[0050] A preset time judgment unit, used to judge whether the statistical data in the real-time distributed storage system HBase is within a preset time;

[0051] The statistical data fitting unit is used to fit the statistical data by an exponentially weighted moving average model if the statistical data in the real-time distributed storage system HBase is within a preset time, so as to obtain a relationship function between the number of calls of the third-party service and the number of callers, wherein the relationship function is expressed as follows:

[0052]

[0053] After iteration, the predicted value S at time t is obtained t , which can be expressed as:

[0054] St =α[Y t-1 +(1-α)Y t-2 +(1-α) 2 Y t-3 ……+(1-α) k Y t-(k+1) ]+(1-α) k+1 S t-(k+1)

[0055] Among them, S t is the predicted value at time t, Y t is the true value at time t, α is the weight coefficient of the exponentially weighted moving average model for statistical data, 0<α<1;

[0056] Let β = 1-α to get the predicted number of calls E of the third-party service, where

[0057]

[0058] Optionally, the third-party service management module includes:

[0059] The deviation rate judgment module is used to calculate the S 1 The deviation rate P between E and

[0060]

[0061] The deviation rate judgment unit is used to judge whether the deviation rate P is greater than or equal to the first preset experience value F 1 ;

[0062] The third-party service management unit is used to if the deviation rate P is greater than or equal to the first preset experience value F 1 , then manage the current third-party service, including: service degradation processing and switching service providers.

[0063] Optionally, the third-party service management unit is used to:

[0064] If the deviation rate P is greater than or equal to F 1 , then determine whether the deviation rate P is less than or equal to the second preset empirical value F 2 ;

[0065] If the deviation rate P is less than or equal to the second preset empirical value F 2 , the call service weight of the current third-party service is lowered through the downgrade component hystrix of the spring framework;

[0066] If the deviation rate P is greater than the second preset empirical value F 2, the call service weight of the current third-party service is adjusted to 0 through the downgrade component hystrix of the spring framework.

[0067] Optionally, the third-party service management device further includes:

[0068] A statistical data storage time determination module is used to determine whether the storage time of the statistical data in the record exceeds a preset time period;

[0069] A call count and caller number statistics module, which is used to collect and count the call count and caller number of third-party services in real time if the storage time of the statistical data in the record exceeds a preset time period, obtain statistical data, and store the statistical data in the real-time distributed storage system HBase;

[0070] The predicted call count prediction module is used to fit the statistical data in the real-time distributed storage system HBase through an exponentially weighted moving average model to obtain a relationship function if the storage time of the statistical data in the record does not exceed a preset time period, and predict the predicted call count E of the third-party service at time t based on the relationship function and the statistical data.

[0071] Optionally, the third-party service management device further includes:

[0072] Feedback delay judgment module, used to judge whether there is a third-party service with feedback delay;

[0073] The weight adjustment module is used to reduce the call service weight of the third-party service through the degradation component hystrix of the spring framework if there is a third-party service with feedback delay.

[0074] Furthermore, to achieve the above-mentioned purpose, the present invention also provides a third-party service management device, which includes a memory, a processor, and a third-party service management program stored in the memory and executable on the processor, and the third-party service management program, when executed by the processor, implements the steps of the third-party service management method as described in any one of the above items.

[0075] Furthermore, to achieve the above objectives, the present invention also provides a computer-readable storage medium, on which a third-party service management program is stored, and when the third-party service management program is executed by a processor, the steps of the third-party service management method as described in any one of the above items are implemented.

[0076] The present invention fits the functional relationship between current data and historical data through the exponential weighted moving average model to obtain the predicted value. In order to check whether the predicted value meets the expectation, the deviation value is calculated. The predicted value is checked by the deviation value to check whether it meets the conditions, so as to achieve the purpose of timely feedback of the service call result. In addition, considering that the data is constantly updated in different time periods, the historical data dynamic training model is adopted, so that the predicted value output by the model always maintains a high accuracy, thereby improving the accuracy of the management call of the third service. BRIEF DESCRIPTION OF THE DRAWINGS

[0077] Figure 1 A schematic diagram of the structure of the operating environment of the third-party service management device involved in the embodiment of the present invention;

[0078] Figure 2 It is a flowchart of the first embodiment of the third-party service management method of the present invention;

[0079] Figure 3 It is a flowchart of a second embodiment of the third-party service management method of the present invention;

[0080] Figure 4 for Figure 2 A detailed flow chart of an embodiment of step S20;

[0081] Figure 5 for Figure 2 A detailed flow chart of an embodiment of step S40;

[0082] Figure 6 for Figure 5 A detailed flow chart of an embodiment of step S403;

[0083] Figure 7 It is a flowchart of a third embodiment of the third party service management method of the present invention;

[0084] Figure 8 This is a flow chart of a fourth embodiment of the third-party service management method of the present invention;

[0085] Fig. 9 This is a functional module diagram of an embodiment of a third-party service management device of the present invention.

[0086] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0087] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0088] The third-party service management method involved in the embodiment of the present invention is mainly applied to a third-party service management device, which may be a device with display and processing functions such as a PC, a portable computer, or a mobile terminal.

[0089] Reference Figure 1 , Figure 1 The hardware structure diagram of the third-party service management device involved in the embodiment of the present invention is shown in FIG. In the embodiment of the present invention, the third-party service management device may include a processor 1001 (e.g., a CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components; the user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard); the network interface 1004 may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface); the memory 1005 may be a high-speed RAM memory, or a stable memory (non-volatile memory), such as a disk memory, and the memory 1005 may optionally be a storage device independent of the aforementioned processor 1001.

[0090] Those skilled in the art will understand that Figure 1 The hardware structure shown in the figure does not constitute a limitation on the third-party service management device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0091] Continue to refer to Figure 1 , Figure 1 The memory 1005 as a computer-readable storage medium may include an operating system, a network communication module, and a third-party service management program.

[0092] exist Figure 1 In the embodiment, the network communication module is mainly used to connect to the server and perform data communication with the server; and the processor 1001 can call the third-party service management program stored in the memory 1005 and execute the third-party service management method provided in the embodiment of the present invention.

[0093] An embodiment of the present invention provides a third-party service management method.

[0094] Reference Figure 2 , Figure 2 1 is a flow chart of a first embodiment of the third-party service management method of the present invention. In this embodiment, the third-party service management method includes:

[0095] Step S10: Use the data collection system Flume to collect and count the number of calls to third-party services and the number of callers in real time, obtain statistical data, and store the statistical data in the real-time distributed storage system HBase of the record table;

[0096] In this embodiment, data at each time point can be collected in real time. The data at each time point includes the number of calls to third-party services and the number of callers. For example, if caller A calls a third service ten times, then the number of callers is 1, and the number of calls to the third-party service is 10. After obtaining the statistical data, store the statistical data in the real-time distributed storage system HBase.

[0097] Step S20: Fit the statistical data in the real-time distributed storage system HBase through the exponentially weighted moving average method model to obtain a relationship function, and predict the predicted number of calls E of the third-party service at time t based on the relationship function and the statistical data;

[0098] In this embodiment, the actual number of calls S to the third-party service at time t can be detected and recorded through a preset monitoring system 1 The exponentially weighted moving average method means that the weight coefficients of each value decrease exponentially with time, and the weight coefficients of the values closer to the current time are larger. In order to obtain the relationship between the number of calls to the third-party service and the number of callers, it is necessary to fit a relationship function, which can be fitted through a fitting algorithm. Theoretically, the number of callers C should be linearly proportional to the number of calls S(t), but in practice it is often non-linear, so non-linear fitting is required. Considering that the number of callers C(t-i) in the closer time period before has an impact on the current service number S(t), and the impact of the number of callers C(t-k) in the farther time period is greater (i < k), the exponentially weighted moving average EWMA fitting effect is better. The mean value obtained after exponential weighting is used as the basis for the correlation algorithm, combining historical retrospective data and current data to make the obtained correlation coefficient more accurate.

[0099] Step S30: Monitor and obtain the actual number of calls S of the third-party service at time t 1 ;

[0100] In this embodiment, time t can be a certain time point in a week or a month. The actual number of calls S to the third-party service at time t can be monitored through a preset monitoring system 1 S 1 is the actual number of calls.

[0101] Step S40: Calculate S through a preset formula 1The deviation rate P between E and the current third-party service is managed based on the relationship between the deviation rate P and the preset experience value. The management includes: service degradation processing and switching service providers.

[0102] In this embodiment, downgrading refers to reducing the proportion of the current third-party service, that is, when there is a request to obtain a third-party service, the non-downgraded third-party service is called first, and then the downgraded third-party service is called. Switching refers to reducing the proportion of the current third-party service to 0, that is, when there is a request to obtain a third-party service, the current third-party service is skipped until a third-party service with a non-zero proportion is called.

[0103] The functional relationship between current data and historical data is fitted through the exponentially weighted moving average model to obtain the predicted value. In order to test whether the predicted value meets expectations, the deviation value is calculated. The deviation value is used to test whether the predicted value meets the conditions, thereby achieving the purpose of timely feedback on service call results.

[0104] Reference Figure 3 , Figure 3 This is a flow chart of the second embodiment of the third-party service management method of the present invention. In this embodiment, in step S20, the statistical data in the real-time distributed storage system HBase is fitted by an exponentially weighted moving average model to obtain a relationship function, and before predicting the predicted call count E of the third-party service at time t based on the relationship function and the statistical data, it also includes:

[0105] Step S50, training the initial exponentially weighted moving average method model using a preset first training sample set according to a preset number of training times, and obtaining an initial prediction value;

[0106] In this embodiment, the initial exponentially weighted moving average model does not have the ability to accurately predict. Therefore, it is necessary to train the initial exponentially weighted moving average model according to a preset number of training times by presetting a first training sample set to obtain an initial prediction value. The preset first training sample is data on known specific values ​​and the fitting relationship between the values.

[0107] Step S60, judging whether the accuracy of the initial prediction value is greater than or equal to the preset accuracy according to the preset actual value;

[0108] In this embodiment, in order to obtain a model in which the accuracy of the output prediction value is greater than or equal to the preset accuracy, it is necessary to preset the expected accuracy, for example, 98%.

[0109] Step S70, if the accuracy of the initial prediction value is greater than or equal to the preset accuracy, then an exponentially weighted moving average method model is obtained;

[0110] Step S80, if the accuracy of the initial prediction value is less than the preset accuracy, the initial exponentially weighted moving average method model is trained according to the exhaustive method until the accuracy of the initial prediction value is greater than or equal to the preset accuracy, thereby obtaining the exponentially weighted moving average method model.

[0111] In this embodiment, when the accuracy of the output prediction value is greater than or equal to the preset accuracy, the exponential weighted moving average method model is obtained, but the premise is that the preset number of training times is met, so that the model prediction effect can be guaranteed to a greater extent. When the accuracy of the output prediction value is less than the preset accuracy, it means that after the preset number of training times, the model is still able to make accurate predictions. Therefore, more data to be trained needs to be input into the initial model. In this embodiment, the exhaustive method is used, for example, data within a week or a month are all used as data to be trained.

[0112] Reference Figure 4 , Figure 4 for Figure 2 In this embodiment, step S20 is to fit the statistical data in the real-time distributed storage system HBase through an exponentially weighted moving average model to obtain a relationship function, and predict the predicted number of calls E of the third-party service at time t based on the relationship function and the statistical data, including:

[0113] Step S201, determining whether the statistical data in the real-time distributed storage system HBase is within a preset time;

[0114] In this embodiment, since the weight coefficient of each numerical value decreases exponentially with time, the closer the numerical weight coefficient is to the current moment, the greater the weight coefficient is. Therefore, the impact of data that is too far away on the prediction result is very small. If the data at a certain moment in the future is to be predicted based on all the data, the calculation amount of the model will increase and more time will be consumed. Therefore, it is necessary to limit the time, for example, only use data within one month from the current time.

[0115] Step S202: If the statistical data in the real-time distributed storage system HBase is within a preset time, the statistical data is fitted by an exponentially weighted moving average model to obtain a relationship function between the number of calls to the third-party service and the number of callers.

[0116] The relationship function is expressed as follows:

[0117]

[0118] After iteration, the predicted value S at time t is obtained t , which can be expressed as:

[0119] S t =α[Yt-1 +(1-α)Y t-2 +(1-α) 2 Y t-3 ……+(1-α) k Y t-(k+1) ]+(1-α) k+1 S t-(k+1)

[0120] Among them, S t is the predicted value at time t, Y t is the true value at time t, α is the weight coefficient of the exponentially weighted moving average model for statistical data, 0<α<1;

[0121] Let β = 1-α to get the predicted number of calls E of the third-party service, where

[0122]

[0123] In this embodiment, the predicted value at a specific moment can be calculated by the formula, where t is a time unit, which can be either seconds or days. E is a value predicted by the prediction model based on the data at moment t, or the data at moment t-1, or the data at moment tn.

[0124] Reference Figure 5 , Figure 5 for Figure 2 In this embodiment, step S40 manages the current third-party service based on the relationship between the deviation rate P and the preset experience value, and the management includes: service degradation processing and switching service providers include:

[0125] Step S401, calculate S by the following formula 1 Deviation rate P from E:

[0126] In this embodiment, the deviation rate represents the degree of deviation between the actual value and the predicted value. Even if the prediction model can predict the value within a certain period of time, the data is constantly updated, and the model must be optimized in real time to ensure a certain degree of accuracy. However, the cost of real-time optimization is too high. Therefore, it is necessary to calculate the deviation rate between the predicted value predicted by the model and the actual number of calls.

[0127] Step S402: determine whether the deviation rate P is greater than or equal to a first preset empirical value F 1 ;

[0128] In this embodiment, in order to meet the current scenario, that is, to allow a certain error in the predicted value output by the model, an empirical value needs to be pre-set to control the range of the error. For example, when the monitoring program monitors that the number of calls to the third-party SMS verification code service is 100,000 times when the business data is 800,000 times, the pre-set empirical value F 1 It can be 1. After the model prediction, the number of calls to the third-party SMS verification code service is 500,000. Substitute it into the formula:

[0129] We get P=1.

[0130] Step S403: If the deviation rate P is greater than or equal to the first preset empirical value F 1 , then manage the current third-party services, including: service degradation processing and switching service providers.

[0131] In this embodiment, the larger the P value is compared to the empirical value, the greater the deviation between the predicted value and the actual value will be. This means that it is predicted that there will be an abnormal call to the third-party service at time t. Therefore, when P is greater than or equal to the first preset empirical value F 1 , an exception handling process is required.

[0132] Reference Figure 6 , Figure 6 for Figure 5 In this embodiment, in step S403, if the deviation rate P is greater than or equal to the first preset experience value F 1 , then manage the current third-party services, including: service degradation processing and switching service providers including:

[0133] Step S4031, if the deviation rate P is greater than or equal to F 1 , then determine whether the deviation rate P is less than or equal to the second preset empirical value F 2 ;

[0134] In this embodiment, different experience values ​​correspond to different execution strategies.

[0135] Step S4032: If the deviation rate P is less than or equal to the second preset empirical value F 2 , the call service weight of the current third-party service is lowered through the downgrade component hystrix of the spring framework;

[0136] Step S4033: If the deviation rate P is greater than the second preset empirical value F 2 , the call service weight of the current third-party service is adjusted to 0 through the downgrade component hystrix of the spring framework.

[0137] In this embodiment, hystrix is ​​a component for downgrading, limiting and fusing service calls. After the weight of the third-party service is lowered, when the service is called again, the number of calls to the third-party service should be reduced, and the weight is adjusted to 0, which means that the current third-party service is no longer used. If the service needs to be called, only other third-party services can be called. The higher the number of times the third-party service is called, the higher the weight of the third-party service in this embodiment. Third-party services with different weights can be extracted in the form of columns, and the ones in the front have higher weights. It can also be in the form of a thread pool, and different threads are managed by managing the thread pool class. There is a corresponding relationship between threads and third-party services.

[0138] Reference Figure 7 , Figure 7 1 is a flow chart of the third embodiment of the third-party service management method of the present invention. In this embodiment, in step S20, the statistical data in the real-time distributed storage system HBase is fitted by an exponentially weighted moving average model to obtain a relationship function, and before predicting the predicted call count E of the third-party service at time t based on the relationship function and the statistical data, it also includes:

[0139] Step S90, determining whether the storage time of the statistical data in the record exceeds a preset time period;

[0140] In this embodiment, since using data in different time periods as training data for the model will affect the prediction efficiency of the model, for example, using data from a shopping festival period to predict sales in a commodity sales off-season will result in deviations.

[0141] Step S100, if the storage time of the statistical data in the record exceeds the preset time period, the step of collecting and counting the number of calls and the number of callers of the third-party service in real time to obtain statistical data, and storing the statistical data in the real-time distributed storage system HBase;

[0142] Step S110, if the storage time of the statistical data in the record does not exceed the preset time period, the statistical data in the real-time distributed storage system HBase is fitted through the exponentially weighted moving average model to obtain the relationship function, and the predicted number of calls E of the third-party service at time t is predicted based on the relationship function and the statistical data.

[0143] In this embodiment, after predicting the data at a certain moment in the future based on the data in the historical time period and calculating the deviation, and managing the current third-party service based on the relationship between the deviation rate P and the preset experience value, in each preset time period, assuming that the first preset time period is from the 1st day to the 30th day, the second preset time period is from the 31st to the 60th day... and so on, multiple preset time periods can be obtained. If the current time exceeds the first preset time period, it is necessary to enter the next time period. Since the data in different time periods are continuously updated, the prediction model can be continuously optimized through the data in different time periods.

[0144] Reference Figure 8 , Figure 8 FIG. 4 is a flow chart of a fourth embodiment of the third-party service management method of the present invention. In this embodiment, in step S50, S is calculated by a preset formula. 1 The deviation rate P between E and the current third-party service is managed based on the relationship between the deviation rate P and the preset experience value. The management includes: service degradation processing and switching service providers, and also includes:

[0145] Step S110, determining whether there is a third-party service with delayed feedback;

[0146] In this embodiment, a heartbeat packet may be preset to record the time from initiating a request to obtain a service to actually obtaining the service.

[0147] Step S120: If there is a third-party service with delayed feedback, the call service weight of the third-party service is lowered through the downgrade component hystrix of the spring framework.

[0148] In this embodiment, in a scenario where there are multiple third-party services, when a service call peak occurs, some third-party services may have feedback delays due to being called multiple times in a short period of time. At this time, the third-party services with feedback delays can be downgraded through the downgrading component, and the services can be provided through the third-party services after the service call peak disappears.

[0149] The exponentially weighted moving average model is used to fit the functional relationship between current data and historical data to obtain the predicted value. In order to verify whether the predicted value meets expectations, the deviation value is calculated. The deviation value is used to verify whether the predicted value meets the conditions, thereby achieving the purpose of timely feedback of service call results. In addition, considering that data is constantly updated in different time periods, the historical data dynamic training model is used to ensure that the predicted value output by the model always maintains a high accuracy rate.

[0150] Reference Fig. 9 , Fig. 9This is a functional module diagram of an embodiment of a third-party service management device of the present invention. In this embodiment, the third-party service management device includes:

[0151] The statistical data storage module 10 is used to collect and count the number of calls and the number of callers of the third-party service in real time through the data collection system Flume, obtain statistical data, and store the statistical data in the record table real-time distributed storage system HBase;

[0152] The third-party service call count prediction module 20 is used to fit the statistical data in the real-time distributed storage system HBase through an exponentially weighted moving average model to obtain a relationship function, and predict the predicted call count E of the third-party service at time t based on the relationship function and the statistical data;

[0153] The monitoring module 30 is used to monitor and obtain the actual number of calls S of the third-party service at the time t. 1 ;

[0154] The third-party service management module 40 is used to calculate the S 1 and the deviation rate P between E, and based on the relationship between the deviation rate P and the preset experience value, managing the current third-party service, wherein the management includes: service degradation processing and switching service providers.

[0155] In this embodiment, the third-party service call count prediction module in this device can predict the number of calls to the third-party service at future time t based on historical statistical data, and the third-party service management module can manage the third-party service based on the deviation rate P, thereby improving the management efficiency of the third-party service.

[0156] The present invention also provides a computer-readable storage medium.

[0157] In this embodiment, a third-party service management program is stored on the computer-readable storage medium, and when the third-party service management program is executed by the processor, the steps of the third-party service management method described in any of the above embodiments are implemented.

[0158] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM) and includes a number of instructions for enabling a terminal (which can be a mobile phone, a computer, a server or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0159] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the enlightenment of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims. All equivalent structures or equivalent process changes made using the contents of the specification and drawings of the present invention, or directly or indirectly used in other related technical fields, are protected by the present invention.

Claims

1. A third-party service management method, characterized in that: include: The data collection system Flume collects and counts the number of calls and the number of callers of third-party services in real time to obtain statistical data, and stores the statistical data in the real-time distributed storage system HBase; Determining whether the storage time of the statistical data in the record exceeds a preset time period; If the storage time of the statistical data in the record exceeds the preset time period, the steps of collecting and counting the number of calls and the number of callers of the third-party service in real time to obtain statistical data, and storing the statistical data in the real-time distributed storage system HBase are performed; If the storage time of the statistical data in the record does not exceed the preset time period, the step of fitting the statistical data in the real-time distributed storage system HBase through an exponentially weighted moving average model to obtain a relationship function, and predicting the predicted number of calls E of the third-party service at time t based on the relationship function and the statistical data; Fitting the statistical data in the real-time distributed storage system HBase through an exponentially weighted moving average model to obtain a relationship function, and predicting the predicted number of calls E of the third-party service at time t based on the relationship function and the statistical data; Monitor and obtain the actual number of calls to the third-party service at time t ; The preset formula is used to calculate the The deviation rate between the E , and based on the deviation rate The relationship between the size of the preset experience value and the current third-party service is managed, and the management includes: service degradation processing and switching service providers; The statistical data in the real-time distributed storage system HBase is fitted by an exponentially weighted moving average model to obtain a relationship function, and the predicted number of calls E of the third-party service at time t is predicted based on the relationship function and the statistical data, including: Determine whether the statistical data in the real-time distributed storage system HBase is within a preset time; If the statistical data in the real-time distributed storage system HBase is within a preset time, the statistical data is fitted by an exponentially weighted moving average model to obtain a relationship function between the number of calls to the third-party service and the number of callers, wherein the relationship function is expressed as follows: After iteration, the predicted value at time t is obtained , which can be expressed as: in, is the predicted value at time t, is the true value at time t, is the weight coefficient of the exponentially weighted moving average model for statistical data, ; make Get the predicted number of calls E of the third-party service, where 。 2. The third-party service management method according to claim 1, characterized in that: Before fitting the statistical data in the real-time distributed storage system HBase by an exponentially weighted moving average model to obtain a relationship function and predicting the predicted number of calls E of the third-party service at time t based on the relationship function and the statistical data, the method further includes: According to the preset training times, the initial exponentially weighted moving average method model is trained using the preset first training sample set, and an initial prediction value is obtained; Determine whether the accuracy of the initial prediction value is greater than or equal to the preset accuracy according to the preset actual value; If the accuracy of the initial prediction value is greater than or equal to the preset accuracy, an exponentially weighted moving average model is obtained; If the accuracy of the initial prediction value is less than the preset accuracy, the initial exponentially weighted moving average model is trained according to the exhaustive method until the accuracy of the initial prediction value is greater than or equal to the preset accuracy, thereby obtaining an exponentially weighted moving average model.

3. The third-party service management method according to claim 1, characterized in that: The preset formula is used to calculate the The deviation rate between the E , and based on the deviation rate The relationship between the preset experience value and the current third-party service is managed, and the management includes: service degradation processing and switching service providers, including: The following formula is used to calculate the The deviation rate between the E : ; Judgment deviation rate Is it greater than or equal to the first preset experience value? ; If the deviation rate Greater than or equal to the first preset experience value , then manage the current third-party service, including: service degradation processing and switching service providers.

4. The third-party service management method according to claim 3, characterized in that: If the deviation rate Greater than or equal to the first preset experience value , then manage the current third-party service, the management includes: service degradation processing and switching service providers include: If the deviation rate Greater than or equal to , then determine the deviation rate Is it less than or equal to the second preset experience value? ; If the deviation rate Less than or equal to the second preset experience value , the call service weight of the current third-party service is lowered through the downgrade component hystrix of the spring framework; If the deviation rate Greater than the second preset experience value , the call service weight of the current third-party service is adjusted to 0 through the downgrade component hystrix of the spring framework.

5. The third-party service management method according to any one of claims 1 to 4, characterized in that: In the above method, the preset formula is used to calculate the The deviation rate between the E , and based on the deviation rate The relationship between the size of the preset experience value and the current third-party service is managed, and the management includes: service degradation processing and switching service providers, and then also includes: Determine if there is a third-party service with delayed feedback; If there is a third-party service with delayed feedback, the call service weight of the third-party service can be reduced through the spring framework's downgrade component hystrix.

6. A third-party service management device, characterized in that: The third-party service management device includes the following modules: The statistical data storage module is used to collect and count the number of calls and the number of callers of the third-party service in real time through the data collection system Flume, obtain statistical data, and store the statistical data in the record table real-time distributed storage system HBase; A statistical data storage time determination module is used to determine whether the storage time of the statistical data in the record exceeds a preset time period; A call count and caller number statistics module, which is used to collect and count the call count and caller number of third-party services in real time if the storage time of the statistical data in the record exceeds a preset time period, obtain statistical data, and store the statistical data in the real-time distributed storage system HBase; A predicted call count prediction module is used for, if the storage time of the statistical data in the record does not exceed a preset time period, executing the step of fitting the statistical data in the real-time distributed storage system HBase through an exponentially weighted moving average model to obtain a relationship function, and predicting the predicted call count E of the third-party service at time t based on the relationship function and the statistical data; A third-party service call count prediction module is used to fit the statistical data in the real-time distributed storage system HBase through an exponentially weighted moving average model to obtain a relationship function, and predict the predicted call count E of the third-party service at time t based on the relationship function and the statistical data; The monitoring module is used to monitor and obtain the actual number of calls to the third-party service at time t. ; The third-party service management module is used to calculate the The deviation rate between the E , and based on the deviation rate The relationship between the size of the preset experience value and the current third-party service is managed, and the management includes: service degradation processing and switching service providers; The third-party service call frequency prediction module includes: A preset time judgment unit, used to judge whether the statistical data in the real-time distributed storage system HBase is within a preset time; The statistical data fitting unit is used to fit the statistical data by an exponentially weighted moving average model if the statistical data in the real-time distributed storage system HBase is within a preset time, so as to obtain a relationship function between the number of calls of the third-party service and the number of callers, wherein the relationship function is expressed as follows: After iteration, the predicted value at time t is obtained , which can be expressed as: in, is the predicted value at time t, is the true value at time t, is the weight coefficient of the exponentially weighted moving average model for statistical data, ; make Get the predicted number of calls E of the third-party service, where 。 7. The third-party service management device according to claim 6, characterized in that: The third-party service management device also includes: A training module, used to train the initial exponentially weighted moving average method model according to a preset number of training times using a preset first training sample set, and obtain an initial prediction value; An accuracy judgment module, used to judge whether the accuracy of the initial prediction value is greater than or equal to a preset accuracy according to a preset actual value; An exponentially weighted moving average method model acquisition module, used to obtain an exponentially weighted moving average method model if the accuracy of the initial prediction value is greater than or equal to a preset accuracy; The initial exponentially weighted moving average model continues to train the model according to the exhaustive method if the accuracy of the initial prediction value is less than the preset accuracy, so as to obtain the exponentially weighted moving average model.

8. The third-party service management device according to claim 6, characterized in that: The third-party service management module includes: The deviation rate judgment module is used to calculate the The deviation rate between the E : ; Deviation rate judgment unit, used to judge the deviation rate Is it greater than or equal to the first preset experience value? ; The third-party service manages the unit for if the deviation rate Greater than or equal to the first preset experience value , then manage the current third-party service, including: service degradation processing and switching service providers.

9. A third-party service management device, characterized in that: The third-party service management device includes a memory, a processor, and a third-party service management program stored in the memory and executable on the processor. When the third-party service management program is executed by the processor, the steps of the third-party service management method as described in any one of claims 1 to 5 are implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a third-party service management program, and when the third-party service management program is executed by the processor, the steps of the third-party service management method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Method and device for predicting system computing resource based on exponential smoothing prediction

    CN105912436A

  • Method and system for monitoring abnormal query

    CN108985482A