Service advanced monitoring method and system combined with artificial intelligence algorithm
By constructing a predictive model using artificial intelligence algorithms, and combining order volume, API calls, and server CPU utilization, early monitoring of the SaaS system was achieved, solving the problem of failure to provide timely warnings in existing technologies and improving system stability and resource utilization efficiency.
Patent Information
- Application Number
- CN202410971645.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-19
- Publication Date
- 2024-11-12
AI Technical Summary
Existing technologies in SaaS systems targeting end-users (C-end) fail to provide effective early warnings of server performance issues, leading to system service crashes or performance degradation, and making timely intervention impossible.
Artificial intelligence algorithms are used to build predictive models for order volume, API calls, and server CPU utilization. By collecting online order data, backend API call logs, and server operation data, a time-series prediction model is constructed to predict future resource usage and provide early warnings.
It enables early monitoring of server performance, improves system service stability, allows administrators to intervene in advance, allocate resources rationally, and avoid service crashes.
Smart Images

Figure CN118939513A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of service monitoring technology, and in particular to a service advance monitoring method and system combined with an artificial intelligence algorithm. Background Art
[0002] When building a SaaS system for C-end users, the backend database access system needs to support not only access requests from various applications, but also the customer's call for system data. When online customers conduct activities or marketing, which leads to a sudden increase in user traffic, and a sudden surge in customer calls for system data, the system access volume will increase, resulting in excessive use of backend service cluster resources, causing system service access performance to decline, and even causing system service crashes.
[0003] The current mainstream system service performance monitoring approach is to monitor cluster CPU utilization, memory usage and other server resource usage in real time, and to perform different threshold alarm management and control for specific scenarios and specific data storage clusters. For example, when the CPU utilization reaches 90%, an alarm is generated and the system operation and maintenance management personnel are notified to intervene.
[0004] In the patent application number CN111679958A, the application name is "A Server Monitoring System", a server monitoring system is disclosed. The data acquisition module transmits the collected server information data to the data processing module. The data processing module identifies, analyzes, and processes the obtained server information data and transmits the processed data to the data storage module for storage. The data in the data storage module is summarized and visualized through the data display module. When the data processing module identifies the server abnormality, it transmits the abnormal information to the alarm module to trigger the alarm. The operation and maintenance assistant module is connected to the data processing module through the data transmission module and monitors the system operation. Through the data reporting with a period of 10 seconds, the real-time monitoring and data validity are increased; multi-dimensional indicator monitoring comprehensively displays the overall picture of server performance; the alarm rules can be configured by combining the alarm functions to customize the alarm strategy.
[0005] In the patent with application number CN117389845A and application name "A server monitoring system with abnormal alarm function", a server monitoring system with abnormal alarm function is disclosed, including an information collection module for collecting server operation information; a real-time monitoring module for real-time monitoring of the server after collecting the server operation information, and the real-time monitoring module is connected to the information collection module; a statistical monitoring module for statistical monitoring of the server after collecting the server operation information, and the statistical monitoring module is connected to the information collection module; a security module for warning users when the server is in a dangerous state and taking security measures for the server data. The security module is connected to the real-time monitoring module and the statistical monitoring module to pre-alarm the server. However, the above two patent schemes only consider the server statistical information, and the server statistical information is the result. The early warning achieved without combining the main factors such as interface calls and actual business development is still relatively limited. When the system performance reaches the monitoring threshold, it is often too late to guarantee the cluster performance, and the system service stability has to be guaranteed by service degradation or triggering fuses. Summary of the invention
[0006] The purpose of the present invention is to solve the shortcomings of the prior art, use business data to assist judgment to achieve advance monitoring of server performance, so as to achieve early intervention through alarm warning, ensure system service stability by adding spare servers, switching high-performance cluster servers, etc., and more reasonably allocate server resource usage through prediction of future business volume and resource usage, so as to improve the efficiency of server resource usage, and provide a service advance monitoring method combined with artificial intelligence algorithm, including the following steps:
[0007] S1: Obtain storage information including online order data, backend interface call log data and server operation data, and store the storage information in a database;
[0008] S2: constructing an order quantity timing prediction model, an interface call timing prediction model and a server CPU utilization prediction model according to the storage information and the alarm rule set;
[0009] S3: The order volume timing prediction model, the interface call timing prediction model and the server CPU utilization prediction model perform real-time data prediction according to the alarm rules and the alarm rule set, and determine whether to trigger the alarm rules according to the order volume, the interface call volume and the CPU usage.
[0010] Preferably, in step S1, obtaining online order data further includes:
[0011] The exception processing duration of the alarm rule is used as a time scale, user order data is collected in real time according to the user's operation on the online program, and the order data is summarized according to the time scale to obtain the online order data.
[0012] Preferably, in step S1, obtaining background call log data further includes:
[0013] A reporting mechanism is added to the interface call service, the interface is ID-encoded according to the reporting mechanism, and the duration of the interface call including the start call time, the end call time and the total call time calculated based on the start call time and the end call time is recorded, the total call time of the interface is sorted, and it is determined whether the interface operation time exceeds the interface threshold, and the interface call log data that exceeds the interface threshold is stored in the database.
[0014] Preferably, in step S1, the obtaining of server operation data further comprises:
[0015] Statistics are collected on the server operation status including CPU utilization, memory usage and load characteristics within a time scale, a status label is set for the server operation status, the status label is modified to a final label according to the server operation status by manual addition or script monitoring, and the server operation data including the server operation status and the final label is stored in a database.
[0016] Preferably, in step S2, constructing the order quantity time series forecasting model further includes:
[0017] Time series training data is constructed according to the online order data, and operations including null value processing and standardization are performed on the time series training data. Stationarity analysis is performed on the time series training data, and the training model is optimized through difference order and parameter tuning method, and finally the order volume time series prediction model is constructed.
[0018] Preferably, in step S2, the construction interface calls the time series prediction model, further comprising:
[0019] Based on the total call time within the time scale as the prediction target, construct data service interface call data, perform interface training model and parameter tuning based on the data service interface call data, and save the final interface training model as the interface call timing prediction model.
[0020] Preferably, in step S2, constructing a server CPU utilization prediction model further includes:
[0021] The online order data within several time ranges, the background interface call log data and the server operation data are taken as sample sets, and data processing is performed according to the features constructed by the sample sets to obtain feature data. Feature screening is performed according to the importance of the feature data, and features that meet the conditions are taken as selected feature sets, and features that do not meet the conditions are taken as candidate feature sets. A utilization training model is performed and parameters are optimized based on the selected feature sets, and the final utilization training model is saved.
[0022] Preferably, in step S3, the alarm rule further includes:
[0023] The online order data is selected according to the sampling range to obtain a sample set, and the sample set with freeze or crash is selected as a warning sample according to the status label, the order quantity a recorded in the warning sample is traversed, and the number b of normal records exceeding the order quantity a in the sample set is counted, and the number c of records exceeding the order quantity a in the warning sample is counted, and the ratio of c / (b+c) is calculated. When the warning threshold is exceeded, a rule is set to trigger an alarm when the number of orders exceeds the warning threshold within the time window. When the alarm is triggered, the alarm information is promptly notified to the system administrator according to the alarm rule, so that the system administrator can intervene in advance.
[0024] Preferably, in step S3, the real-time data prediction further comprises:
[0025] Order volume prediction: obtaining the online order data within a set time, optimizing the training model according to the order determined by the differential order and the parameter tuning method, and predicting the order volume data within a set time in the future;
[0026] Interface call prediction: according to the online order data, the background interface call log data and the feature values of the online order data within a set time, the interface call timing prediction model is loaded to predict the interface call data within a set time in the future;
[0027] CPU utilization prediction: predicts the interface call data for the next time scale in the future based on the online order data, background interface call log data, server operation data and feature values of the online order data within a set time.
[0028] A service advance monitoring system combined with artificial intelligence algorithms, including:
[0029] An online order data module is used to collect and store online order data in a database, and to construct an order volume time series prediction model based on the online order data and an alarm rule set;
[0030] A background call log collection module is used to collect and store background interface call log data in a database, and to construct an interface call timing prediction model based on the background interface call log data and the alarm rule set;
[0031] A server resource module, used to collect and store server operation data in a database, and construct a server CPU utilization prediction model based on the server operation data and the alarm rule set;
[0032] The monitoring alarm module, the order volume timing prediction model, the interface call timing prediction model and the server CPU utilization prediction model perform real-time data prediction according to the alarm rules and the alarm rule set, and determine whether to trigger the alarm rules according to the order volume, the interface call volume and the CPU usage. When the alarm rules are triggered, an alarm is issued to the backend management personnel.
[0033] Compared with the prior art, the present invention has the following beneficial effects:
[0034] (1) The present invention collects business order data, interface service call data and server operation data respectively, fully considers the actual business growth, and the interface call situation that directly reaches the server performance, the impact on the use of server resources, and statistically mines data rules to enrich the server monitoring and alarm strategy;
[0035] (2) The present invention combines the prediction function of the artificial intelligence algorithm to provide early warning of whether the alarm rules are triggered, allowing system administrators to intervene in advance, greatly improving the stability of system services, and can combine server usage to facilitate system administrators to more reasonably allocate server resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the following detailed description of the preferred embodiment.The drawings are only for the purpose of illustrating the preferred embodiments and are not to be construed as limiting the invention.
[0037] Figure 1 The present invention is a flow chart of a method for early monitoring of services combined with an artificial intelligence algorithm. DETAILED DESCRIPTION
[0038] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.
[0039] Those skilled in the art will appreciate that, unless otherwise stated, the singular forms "a", "an", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present invention refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.
[0040] The technical terms involved in the embodiments of the present invention are defined as follows:
[0041] 1. Data server cluster: This server refers to a dedicated computer cluster that provides database addition, deletion, modification and query services to clients in a network environment. It often contains multiple computing nodes, and external calls are mainly executed through SQL.
[0042] 2. Arima difference process: When using Arima to predict time series data, it is necessary to convert non-stationary series data into stationary series data, so as to reduce or eliminate the trend and seasonal changes of the time series. The difference calculation is to calculate the difference between adjacent data points in the time series data.
[0043] 3. Multiple linear regression model: This model mainly studies the linear dependency between a dependent variable and multiple independent variables. Polynomial regression is a type of linear regression model.
[0044] Example
[0045] This example has two important assumptions:
[0046] (1) Access to the data server cluster is mainly through API interface calling methods, without considering situations such as executing scripts locally on the cluster server and the existence of other services on the server that are not related to the data service;
[0047] (2) Server resources are kept at a constant level. When the server resources are expanded exponentially, the statistical dimensions in the following schemes need to be transformed. For example, CPU usage can be converted into memory usage, etc., and the selected sampling range is appropriately adjusted.
[0048] See also Figure 1 As shown, the present embodiment provides a service advance monitoring method combined with an artificial intelligence algorithm. The present invention collects and stores data on online order flow, backend interface calls, and server operation resource occupancy to form historical data and real-time data. By mining and summarizing historical data, more accurate alarm rules are formed. An artificial intelligence algorithm is constructed by training historical data to predict resource occupancy after a certain time window so as to achieve early warning, which is convenient for backend operation and maintenance personnel to intervene as soon as possible. The method includes the following steps:
[0049] S1: Obtain storage information including online order data, backend interface call log data, and server operation data, and store the storage information in the database;
[0050] S2: Construct order quantity timing prediction model, interface call timing prediction model and server CPU utilization prediction model based on storage information and alarm rule set;
[0051] S3: The order volume timing prediction model, the interface call timing prediction model and the server CPU utilization prediction model perform real-time data prediction according to the alarm rules and the alarm rule set, and determine whether to trigger the alarm rules according to the order volume, the interface call volume and the CPU usage. Specifically, in this embodiment, the order volume timing prediction model, the interface call timing prediction model and the server CPU utilization prediction model respectively predict the order volume, the interface call volume (duration) and the CPU utilization in a certain period of time in the future according to the alarm rules and the alarm rule set, whether the alarm rules will be triggered; if triggered, the alarm information notification is performed through the monitoring alarm module.
[0052] Preferably, in step S1, obtaining online order data further includes:
[0053] The abnormal processing time of the alarm rule is used as the time scale. According to the user's operation on the online program, the user's order data is collected in real time. The order data is summarized according to the time scale to obtain the online order data. Specifically, in this embodiment, each operation of the user in the online program, such as logging in, clicking, accessing, browsing, placing an order or selecting a product, will generate an access request to the background data service cluster, which will cause the cluster service resource to be occupied. The development of online business is closely related to the required cluster resources, but with the development of the business, the total number of users, store expansion, and the addition of new business channels will bring about changes in business conditions. Therefore, collecting online business data is of great help to the subsequent monitoring of server resource occupation. The online order data collection model mainly collects user order data in real time, forms a dimension table through the online order detail table, and counts the total number of orders in time window dimensions such as seconds, minutes, quarters, and hours.
[0054] Preferably, the statistical time scale judgment includes:
[0055] Considering the time taken by system service managers to handle exceptions after server exception alarms, such as adding cluster nodes, going offline or shutting down resource-consuming tasks, which generally do not take more than half an hour, the present invention sets the warning time scale to half an hour.
[0056] Taking the half-hour time scale as the statistical dimension, the order details stored in real time every day are calculated and summarized, and 24 sets of data are generated every day, such as 00:00-00:30, 00:30-01:00, etc. In addition, according to different prediction model implementations, other fields can be added, such as the number of operating stores, and the calculation and summary results of every half hour every day, a total of 24 sets of data, are stored in the database.
[0057] Preferably, in step S1, obtaining background call log data further includes:
[0058] A reporting mechanism is added to the interface call service, and the interface is ID-coded according to the reporting mechanism, and the duration of the start call time, end call time and total call time calculated based on the start call time and end call time of the interface call is recorded, and the total call time of the interface is sorted, and it is determined whether the interface operation time exceeds the interface threshold, and the interface call log data exceeding the interface threshold is stored in the database. Specifically, in this embodiment, the direct method for data server resource occupancy is mainly to access data through API. Server resource occupancy such as CPU utilization is not only related to the number of interface calls in the time period, but also some interface calls take a long time, some take a short time; some interface calls require high CPU resources, some less, etc. At the same time, the same interface will also cause different performance usage due to different input parameters, such as a query API, querying one day's data and querying one month's resource occupancy has a big gap, and the interface call situation is the main reason for the dynamic change of server performance. Collect interface call logs, uniformly ID code each interface, and collect the statistics of each interface call in the background service, such as the start time, end time, call duration, etc. of the interface call, and store the statistical data.
[0059] Preferably, the half-hour time scale is used as the statistical dimension, and the interface call status recorded in the background log every day is calculated and summarized. The interface call status is reported in each interface call service, and the interface ID is recorded, and the start call time, end call time, and total call duration of the interface are recorded. Based on the interface detailed data, the following statistics are constructed:
[0060] a) Number of interface calls within the time window: the total number of times the interface was called within the time window;
[0061] b) Total interface call running time: Taking the time window 11:00-11:30 as an example, filter all interfaces that have been called during this time, set the start time t1 of each interface detail to max (11:00:00.000, interface start time), and the end time t2 to min (11:30:00.000, interface end time), and recalculate the duration of the call record, end time t2-start time t1;
[0062] c) The total call time of the TopN interfaces, which is the total running time of the top N interfaces in the statistical time window;
[0063] d) Count the number of interfaces whose running time exceeds a certain threshold, such as 200ms. Store the interface call statistics fields including but not limited to the above into the database.
[0064] Preferably, in step S1, obtaining server operation data further includes:
[0065] Statistics are collected on the server operating conditions including CPU utilization, memory usage, and load characteristics within a time scale, a status label is set for the server operating status, and the status label is modified to a final label according to the server operating conditions by manual addition or script monitoring, and the server operating data including the server operating conditions and the final label are stored in a database. Specifically, in this embodiment, statistics are collected on a certain time scale, such as every 3 seconds, including the server CPU utilization, memory usage, load, and other data, as well as the server operating conditions at this time, such as freezes, service crashes, etc., and the data are stored in a database.
[0066] Preferably, develop a collection script to monitor the server operation in real time, and record it every 3 seconds as detailed data and store it in the database. Use the half-hour time scale as the statistical dimension, calculate and summarize the detailed records, and construct the following statistical dimensions:
[0067] a) CPU usage characteristics within the time window, taking the average, minimum, and maximum values of CPU usage; memory usage characteristics within the time window, taking the average, minimum, and maximum values of memory usage;
[0068] b) Load characteristics within the time window, taking the average, minimum and maximum values of the load;
[0069] c) The total time that the CPU usage remains above a certain threshold;
[0070] d) The total time that the memory usage rate remains above a certain threshold;
[0071] Record the operating status description within the time scale, including:
[0072] 1) The method of monitoring the operation status of the server is to manually add, such as manually modifying the status label when the system freezes or crashes; the second is to automatically label through scripts, which can customize certain interface services or call and count existing interfaces, and divide each interface into normal conditions, long time consumption, high I / O consumption scripts, high CPU utilization, etc., and record the time consumption when the server runs normally. When recording the server operation data in real time, run these scripts at the same time and count the time consumption. If it is within the previous normal fluctuation range, the status is defined as normal. If the time consumption is extended by a certain amplitude, it is defined as freeze. At the same time, the service call fails and the system crashes. The two methods use the manually modified status label as the final label.
[0073] 2) The above running status details are also counted as statistical features within the time window, such as whether there is a freeze, the number of freezes, etc.;
[0074] 3) Store the server operation statistics fields in the database.
[0075] Preferably, in step S2, constructing an order quantity time series prediction model further includes:
[0076] Based on the online order data, time series training data is constructed, and operations including null value processing and standardization are performed on the time series training data. A stationarity analysis is performed on the time series training data, and the training model is optimized through the difference order and parameter tuning method. Finally, a time series prediction model for order volume is constructed.
[0077] Preferably, an order volume time series forecasting model is constructed, including:
[0078] a) Training order volume prediction model:
[0079] b) Selecting an algorithm model, the present invention selects the timing algorithm Arima algorithm:
[0080] c) Construct time series training data and select 24 sets of order volume data per day in the past two months;
[0081] d) Data processing, such as null value processing and standardization processing, setting the number of orders without transactions in a time period to 0. At the same time, due to the large difference in order volume in each time period, such as the early morning and noon time period with the largest order volume, the data is processed logarithmically to narrow the difference range and reduce the prediction effect error for time periods with small order volumes;
[0082] e) Perform stationarity analysis on the time series data and confirm the order of difference; and use parameter tuning method to determine p and q.
[0083] Furthermore, when applying ARIMA, it is necessary to eliminate the cyclical fluctuations caused by trends or seasons in the time series data. Stationarity analysis is to confirm that the time series data fed to the model is stationary after a series of data processing methods when training the model. Usually, the first step is to draw the trend of the time series data. For example, it can be clearly observed that the order volume is relatively close from Monday to Friday, fluctuating within the same order range, while Saturday and Sunday are obviously beyond it; then the ADF unit root test can be used to confirm whether it is stationary. For example, if the difference order is 0, it is confirmed to be non-stationary. The ADF test can be calculated again with a difference order of 1 until the data is confirmed to be stationary; how many times the difference is stationary is the parameter d selected; the best method in practice is to divide the training test set, and then keep trying which set of parameter combinations can get the best prediction performance. Stationarity analysis is the basis for confirming that the data can use the Arima model, and it is also a method to clarify the parameter d. The parameter tuning method is the second part of the training model. Confirm the parameters p and q. Once p, d, and q are confirmed, the model is trained.
[0084] Furthermore, the parameter setting of the Arima model is significantly related to the trend of historical data. It mainly has three parameters, namely p, d, and q. The best method for determining the parameters p and q in current practice is to constantly try and select the parameters with the best effect. The selection range of p\q is generally a positive integer between 1 and 5. In the training of the Arima order volume prediction model in the present invention, the data processing stage needs to process the data according to different time scales. For example, if an early warning is required one day in advance, the historical data fluctuates according to a cycle of 7 days. The data of each sample point can be subtracted from the data 7 days ago as the current sample data; the present invention adopts a half-hour early warning, with 48 data points per day, and the difference between each sample point and the previous time point of 7*48 can be used as the sample data, so that the total historical data tends to be stable, and the parameter d can select a positive integer in the range of 0 to 3. By preprocessing the data and optimizing the parameters, the prediction performance of the order volume prediction model is improved.
[0085] Preferably, in step S2, constructing an interface to call a time series prediction model further includes:
[0086] Based on the total call time within the time scale as the prediction target, the data service interface call data is constructed, the interface training model and parameter tuning are performed according to the data service interface call data, and the final interface training model is saved as the interface call timing prediction model.
[0087] Preferably, the training service interface call model includes:
[0088] a) Selecting an algorithm model. The present invention adopts a polynomial regression model, taking the total call duration within the time scale as the prediction target;
[0089] b) Construct training data. Data service interface calls mainly come from two aspects: ETL task data acquisition and online user access to the system. ETL tasks are mainly concentrated at night, early morning, and early morning, while online user access to the system is mainly concentrated during the day. ETL tasks are relatively stable every day, while online business changes with the daytime business volume. Considering the change in online business volume, the main data features include not only interface call features, such as the number of calls, call duration, and the total duration of TopN interface calls, but also the order volume data corresponding to the time scale;
[0090] c) Train the model and optimize the parameters, and save the model result file.
[0091] Preferably, in step S2, constructing a server CPU utilization prediction model further includes:
[0092] Online order data, backend interface call log data, and server operation data within a certain time range are taken as sample sets. Data processing is performed according to the features constructed from the sample sets to obtain feature data. Feature screening is performed according to the importance of the feature data. Features that meet the conditions are taken as the selected feature set, and features that do not meet the conditions are taken as the candidate feature set. A utilization training model is performed based on the selected feature set, and parameters are optimized, and the final utilization training model is saved.
[0093] Preferably, train a CPU utilization model, including:
[0094] a) Selecting an algorithm model, the present invention adopts the XGBoost model;
[0095] b) Associate the order volume data, interface call data, and server operation data within the time scale, and select the data within the last three months as the sample set;
[0096] c) Construct features. In addition to order quantity and interface call features, add data from the N previous moments of the sample as features;
[0097] d) Feature engineering: standardize the data, process outliers, combine features, and construct statistical features for continuous features, such as constructing the average value of the order volume at the same time in recent days;
[0098] e) Feature screening: Use feature importance to select the top 20% of features as the selected feature set, and the remaining features as the candidate feature set. The remaining feature sets are sorted in descending order of feature importance and gradually added to the selected feature set. If the model effect is improved, they are retained, otherwise they are discarded;
[0099] f) Train the model and tune the parameters, and save the model result file.
[0100] More optimally, the XGBoost model has multiple parameters, such as the number of trees n_est imators, the maximum depth of the tree max_depth, the learning rate l earn i ng_rate, etc.; the method of parameter tuning is similar to the idea of Arima mentioned above, that is, grid search, such as the number of trees selected [100, 150, 200, 250], the learning rate selected [0.01, 0.05, 0.1], etc., and then different combinations are continuously selected to train the model and get the score, and the group of parameters with the highest score is selected as the final parameters of the model. In actual implementation, in order to pursue the ultimate performance of the model, for example, when the optimal number of trees is 150 in a set of parameters, it can be further subdivided into [140, 150, 160] and iterative evaluation again.
[0101] Preferably, in step S3, the alarm rule further comprises:
[0102] Select online order data according to the sampling range to obtain a sample set, select the sample set with freeze or crash according to the status label as the warning sample, traverse the order volume a recorded in the warning sample, and count the number b of normal records when the sample set records exceed the order volume a, and count the number c of records exceeding the order volume a in the warning sample, calculate the ratio of c / (b+c), and when the warning threshold is exceeded, set a rule that triggers an alarm when the number of orders exceeds the warning threshold within the time window. When the alarm is triggered, the alarm information is promptly notified to the system administrator according to the alarm rule, so that the system administrator can intervene in advance. Specifically, in this embodiment, when the alarm is triggered, the alarm information is promptly notified to the system administrator. The alarm is generally automatically notified through text messages, emails, phone calls, and work software such as WeChat, Feishu, etc. The notification and alarm subsequent processing are not within the key content of the present invention and are not elaborated here.
[0103] Better yet, alarm rule mining includes:
[0104] 1) Use the time window as the correlation field to associate order data, interface call data, and server operation status to form summary data, and perform mining and analysis on the order data.
[0105] a) Select the sampling range, such as the record list A of the past six months, the past three months, or the past year;
[0106] b) Obtain a list of order volume records B where A is stuck or crashed;
[0107] c) Traverse the order volume a recorded in B, and count the number b of normal records when other records in A exceed the order volume a, and count the number c of records in B that exceed the order volume a, calculate the ratio of c / (b+c), and when it exceeds a certain threshold d (the threshold can be set according to the policy strictness, normal, looseness, etc., the threshold is raised when it is strict, and lowered when it is loose), a rule can be set to issue an alarm when the number of orders in the time window exceeds d.
[0108] 2) According to the method in 1), the interface call situation is also statistically mined to specify alarm rules.
[0109] Preferably, in step S3, the real-time data prediction further comprises:
[0110] Order volume prediction: obtain online order data within a set time, optimize the training model according to the order determined by the differential order and the parameter tuning method, and predict the order volume data within the future set time. Specifically, in this embodiment, obtain the order volume data of the previous two months under the current time, use the order, p, q determined in the training stage to load the Arima model, and predict the order volume data of the next time scale in the future;
[0111] Interface call prediction: according to the feature values of online order data, background interface call log data and online order data within a set time, the interface call time series prediction model is loaded to predict the interface call data within a set time in the future. Specifically, in this embodiment, the order volume data and interface call data are associated, the feature values of the previous time scale under the current time are obtained, the trained service interface call model is loaded, and the interface call data of the next time scale in the future is predicted;
[0112] CPU utilization prediction: based on the feature values of online order data, background interface call log data, server operation data and online order data within a set time, predict the interface call data of the next time scale in the future. Specifically, in this embodiment, the order quantity data, interface call data and server operation data are associated, the feature values of the previous time scale under the current time are obtained, the trained feature values of the previous time scale under the current time are loaded, and the interface call data of the next time scale in the future is predicted.
[0113] The protection scope of the present invention is obviously not limited to the above-mentioned specific embodiments, but also includes the following equivalent changes or substitutions for realizing the present invention.
[0114] 1) Other features or equivalent processing methods of online business order data and interface call data, and other feature data such as climate, temperature, number of users, etc. can be enriched;
[0115] 2) The implementation models are not limited to the models mentioned above. For example, the order volume prediction model, interface call model, and CPU utilization model can all be replaced by other model methods such as multivariate regression model, ensemble learning model, and deep learning.
[0116] 3) Similarly, on the time scale, the present invention mainly performs alarm monitoring half an hour in advance, which can be replaced by one hour in advance, one day in advance, etc.
[0117] From experience, the abnormalities of the backend service are caused by a surge in online orders, such as Double Eleven and the first cup of milk tea in autumn, or by customers calling the company's data interface for a long time, which causes a lot of pressure on the server. At this time, a surge in online orders can easily lead to a decline in service performance. At present, the main service monitoring on the market is mainly through observing the operation and use of the server, such as setting an alarm when the memory usage reaches 90%. This method is similar to some methods of using rules to identify faults. There is an obvious disadvantage that you can only know after the event occurs. When it reaches 90%, it may not be able to handle it fully. This embodiment breaks through the previous method of using rules for service monitoring, and adds artificial intelligence methods to perceive and process in advance. Moreover, the need to complete this effective artificial intelligence method also requires a complete interface call log system that can record the call status of each interface, as well as a comprehensive consideration of the situation of online orders.
[0118] This embodiment also provides a service advance monitoring system combined with an artificial intelligence algorithm, including:
[0119] Online order data module, used to collect online order data and store it in the database, and construct an order volume time series prediction model based on online order data and alarm rule sets;
[0120] The backend call log collection module is used to collect and store the backend interface call log data into the database, and construct an interface call timing prediction model based on the backend interface call log data and the alarm rule set;
[0121] The server resource module is used to collect and store server operation data in the database, and construct a server CPU utilization prediction model based on the server operation data and the alarm rule set;
[0122] The monitoring alarm module, order volume timing prediction model, interface call timing prediction model and server CPU utilization prediction model perform real-time data prediction based on alarm rules and alarm rule sets, and determine whether to trigger alarm rules based on order volume, interface call volume and CPU usage. When alarm rules are triggered, an alarm will be issued to the backend management personnel.
[0123] The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.
Claims
1. A service advance monitoring method combined with an artificial intelligence algorithm, characterized in that: The following steps are involved: S1: Obtain storage information including online order data, backend interface call log data and server operation data, and store the storage information in a database; S2: constructing an order quantity timing prediction model, an interface call timing prediction model and a server CPU utilization prediction model according to the storage information and the alarm rule set; S3: The order volume timing prediction model, the interface call timing prediction model and the server CPU utilization prediction model perform real-time data prediction according to the alarm rules and the alarm rule set, and determine whether to trigger the alarm rules according to the order volume, the interface call volume and the CPU usage.
2. A method for early monitoring of services combined with an artificial intelligence algorithm according to claim 1, characterized in that: In step S1, obtaining online order data further includes: The exception processing duration of the alarm rule is used as a time scale, user order data is collected in real time according to the user's operation on the online program, and the order data is summarized according to the time scale to obtain the online order data.
3. The method for early monitoring of services combined with an artificial intelligence algorithm according to claim 2, characterized in that: In step S1, the obtaining of background call log data further includes: A reporting mechanism is added to the interface call service, the interface is ID-coded according to the reporting mechanism, and the duration of the interface call including the start call time, the end call time and the total call time calculated based on the start call time and the end call time is recorded, the total call time of the interface is sorted, and it is determined whether the interface running time exceeds the interface threshold, and the interface call log data that exceeds the interface threshold is stored in the database.
4. The method for early monitoring of services in combination with an artificial intelligence algorithm according to claim 3, characterized in that: In step S1, the obtaining of server operation data further includes: Statistics are collected on the server operation status including CPU utilization, memory usage and load characteristics within a time scale, a status label is set for the server operation status, the status label is modified to a final label according to the server operation status by manual addition or script monitoring, and the server operation data including the server operation status and the final label is stored in a database.
5. The method for early monitoring of services combined with an artificial intelligence algorithm according to claim 4, characterized in that: In step S2, constructing an order quantity time series forecasting model further includes: Time series training data is constructed according to the online order data, and operations including null value processing and standardization are performed on the time series training data. Stationarity analysis is performed on the time series training data, and the training model is optimized through difference order and parameter tuning method, and finally the order volume time series prediction model is constructed.
6. A method for early monitoring of services combined with an artificial intelligence algorithm according to claim 5, characterized in that: In step S2, the construction interface calls the time series prediction model, further comprising: Based on the total call time within the time scale as the prediction target, construct data service interface call data, perform interface training model and parameter tuning based on the data service interface call data, and save the final interface training model as the interface call timing prediction model.
7. A method for early monitoring of services in combination with an artificial intelligence algorithm according to claim 6, characterized in that: In step S2, constructing a server CPU utilization prediction model further includes: The online order data within several time ranges, the background interface call log data and the server operation data are taken as sample sets, and data processing is performed according to the features constructed by the sample sets to obtain feature data. Feature screening is performed according to the importance of the feature data, and features that meet the conditions are taken as selected feature sets, and features that do not meet the conditions are taken as candidate feature sets. A utilization training model is performed and parameters are optimized based on the selected feature sets, and the final utilization training model is saved.
8. A method for monitoring services in advance in combination with an artificial intelligence algorithm according to claim 7, characterized in that: In step S3, the alarm rules include: The online order data is selected according to the sampling range to obtain a sample set, and the sample set with freeze or crash is selected as a warning sample according to the status label, the order quantity a recorded in the warning sample is traversed, and the number b of normal records exceeding the order quantity a in the sample set is counted, and the number c of records exceeding the order quantity a in the warning sample is counted, and the ratio of c / (b+c) is calculated. When the warning threshold is exceeded, a rule is set to trigger an alarm when the number of orders exceeds the warning threshold within the time window. When the alarm is triggered, the alarm information is promptly notified to the system administrator according to the alarm rule, so that the system administrator can intervene in advance.
9. A method for monitoring services in advance in combination with an artificial intelligence algorithm according to claim 8, characterized in that: In step S3, the real-time data prediction further includes: Order volume prediction: obtaining the online order data within a set time, optimizing the training model according to the order determined by the differential order and the parameter tuning method, and predicting the order volume data within a set time in the future; Interface call prediction: according to the online order data, the background interface call log data and the feature values of the online order data within a set time, the interface call timing prediction model is loaded to predict the interface call data within a set time in the future; CPU utilization prediction: predicts the interface call data for the next time scale in the future based on the online order data, background interface call log data, server operation data and feature values of the online order data within a set time.
10. A service advance monitoring system combined with artificial intelligence algorithm, characterized in that: include: An online order data module is used to collect and store online order data in a database, and to construct an order volume time series prediction model based on the online order data and an alarm rule set; A background call log collection module is used to collect and store background interface call log data in a database, and to construct an interface call timing prediction model based on the background interface call log data and the alarm rule set; A server resource module, used to collect and store server operation data in a database, and construct a server CPU utilization prediction model based on the server operation data and the alarm rule set; The monitoring alarm module, the order volume timing prediction model, the interface call timing prediction model and the server CPU utilization prediction model perform real-time data prediction according to the alarm rules and the alarm rule set, and determine whether to trigger the alarm rules according to the order volume, the interface call volume and the CPU usage. When the alarm rules are triggered, an alarm is issued to the backend management personnel.
