CN115617613A - Data early warning method, device, electronic equipment and storage medium - Google Patents
Data early warning method, device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN115617613A CN115617613A CN202211327899.9A CN202211327899A CN115617613A CN 115617613 A CN115617613 A CN 115617613A CN 202211327899 A CN202211327899 A CN 202211327899A CN 115617613 A CN115617613 A CN 115617613A
- Authority
- CN
- China
- Prior art keywords
- function
- fitting
- monitored
- fitted
- functions
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3003—Monitoring arrangements specially adapted to the computing system or computing system component being monitored
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3058—Monitoring arrangements for monitoring environmental properties or parameters of the computing system or of the computing system component, e.g. monitoring of power, currents, temperature, humidity, position, vibrations
-
- G—PHYSICS
- G08—SIGNALLING
- G08B—SIGNALLING OR CALLING SYSTEMS; ORDER TELEGRAPHS; ALARM SYSTEMS
- G08B21/00—Alarms responsive to a single specified undesired or abnormal condition and not otherwise provided for
- G08B21/18—Status alarms
- G08B21/182—Level alarms, e.g. alarms responsive to variables exceeding a threshold
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Quality & Reliability (AREA)
- General Engineering & Computer Science (AREA)
- Mathematical Physics (AREA)
- Business, Economics & Management (AREA)
- Emergency Management (AREA)
- Testing And Monitoring For Control Systems (AREA)
Abstract
Description
技术领域technical field
本申请实施例涉及监控技术领域,具体而言,涉及一种数据预警方法、装置、电子设备及存储介质。The embodiments of the present application relate to the technical field of monitoring, and in particular, to a data early warning method, device, electronic equipment, and storage medium.
背景技术Background technique
信息系统在运行过程中要面对硬件、网络、软件自身等各方面的风险因素,上述因素都可能造成系统服务的质量下降,甚至系统崩溃。During the operation of the information system, it has to face various risk factors such as hardware, network, and software itself. The above factors may cause the quality of system services to decline, or even the system to crash.
目前,系统运维人员为确保系统的平稳运行,往往会在系统上线后为其添加一系列的监控对象,例如,服务时延、服务成功率等,同时设置每一项监控对象的监控阈值。在系统运行过程中,不断对各项监控对象进行采样,当某一项监控对象的数据采样值超过其监控阈值时进行报警。At present, in order to ensure the smooth operation of the system, system operation and maintenance personnel often add a series of monitoring objects after the system goes online, such as service delay, service success rate, etc., and set the monitoring threshold of each monitoring object. During the operation of the system, various monitoring objects are continuously sampled, and an alarm is issued when the data sampling value of a certain monitoring object exceeds its monitoring threshold.
但是,这种方式只能对已经发生的故障进行报警,不能在故障发生前进行预先报警。However, this method can only give an alarm to the faults that have already occurred, and cannot give an early warning before the fault occurs.
发明内容Contents of the invention
本申请实施例的目的在于提供一种数据预警方法、装置、电子设备及存储介质,能够在故障发生前进行准确预警。The purpose of the embodiments of the present application is to provide a data early warning method, device, electronic equipment and storage medium, capable of performing accurate early warning before a fault occurs.
为了实现上述目的,本申请实施例采用的技术方案如下:In order to achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:
第一方面,本申请实施例提供了一种数据预警方法,应用于电子设备,所述方法包括:In the first aspect, the embodiment of the present application provides a data early warning method, which is applied to electronic equipment, and the method includes:
获取待监控对象对应的函数列表,其中,所述函数列表包括多个待拟合函数,一个所述待拟合函数用于表征所述待监控对象的一种变化趋势;Obtaining a function list corresponding to the object to be monitored, wherein the function list includes a plurality of functions to be fitted, and one function to be fitted is used to characterize a change trend of the object to be monitored;
基于所述待监控对象的实际数据值,对所述函数列表中的待拟合函数进行多次拟合,得到目标拟合函数;其中,所述目标拟合函数所表征的所述待监控对象的变化趋势与所述待监控对象的实际变化趋势之间的偏差最小;Based on the actual data value of the object to be monitored, the functions to be fitted in the function list are fitted multiple times to obtain a target fitting function; wherein, the object to be monitored represented by the target fitting function The deviation between the change trend of and the actual change trend of the object to be monitored is the smallest;
利用所述目标拟合函数,对所述待监控对象进行预警。Using the target fitting function, an early warning is given to the object to be monitored.
可选地,所述方法还包括:Optionally, the method also includes:
按照预先设定的采样间隔,周期性采样所述待监控对象的实际数据值;periodically sampling the actual data value of the object to be monitored according to a preset sampling interval;
针对每个采样周期,将所述采样周期及其对应的实际数据值作为一个采样数据,加到预先构建的采样数据集中。For each sampling period, the sampling period and its corresponding actual data value are added as a sampling data to the pre-built sampling data set.
可选地,所述基于所述待监控对象的实际数据值,对所述函数列表中的待拟合函数进行多次拟合,得到目标拟合函数的步骤,包括:Optionally, the step of performing multiple fittings on the functions to be fitted in the function list based on the actual data value of the object to be monitored to obtain the target fitting function includes:
从所述采样数据集中,获取最后一个采样数据及其之前设定数目个采样数据,得到多个候选采样数据;From the sampled data set, obtain the last sampled data and a set number of sampled data before it to obtain a plurality of candidate sampled data;
根据所述多个候选采样数据,对所述函数列表中的每个所述待拟合函数进行拟合,得到每个拟合函数;Fitting each of the functions to be fitted in the function list according to the plurality of candidate sampling data to obtain each fitting function;
对每个所述拟合函数进行验证,并确定出候选拟合函数;其中,所述候选拟合函数所表征的所述待监控对象的变化趋势与所述待监控对象的实际变化趋势之间的偏差最大;Each of the fitting functions is verified, and a candidate fitting function is determined; wherein, the difference between the change trend of the object to be monitored represented by the candidate fitting function and the actual change trend of the object to be monitored the largest deviation;
从所述函数列表中移除所述候选拟合函数对应的待拟合函数;removing the function to be fitted corresponding to the candidate fitting function from the function list;
重复执行上述步骤,直至所述函数列表中仅剩一个所述待拟合函数,将所述待拟合函数在最后一次拟合中得到的拟合函数作为所述目标拟合函数。The above steps are repeated until there is only one function to be fitted left in the function list, and the fitting function obtained in the last fitting of the function to be fitted is used as the target fitting function.
可选地,所述根据所述多个候选采样数据,对所述函数列表中的每个所述待拟合函数进行拟合,得到每个拟合函数的步骤,包括:Optionally, the step of fitting each of the functions to be fitted in the function list according to the plurality of candidate sampling data to obtain each fitting function includes:
针对每个所述待拟合函数,若所述待拟合函数为系统时间函数,则根据所述多个候选采样数据,利用最小二乘法求解所述待拟合函数中的各个系数,得到所述拟合函数;For each of the functions to be fitted, if the function to be fitted is a system time function, then according to the plurality of candidate sampling data, the least squares method is used to solve each coefficient in the function to be fitted to obtain the said fitting function;
若所述待拟合函数为扩展时间函数,则根据所述多个候选采样数据、以及所述扩展时间函数的系数偏导函数组和系数猜测值,利用梯度下降法求解所述待拟合函数中的各个系数,得到所述拟合函数。If the function to be fitted is an extended time function, then according to the plurality of candidate sampling data, the coefficient partial derivative function group and the coefficient guess value of the extended time function, the gradient descent method is used to solve the function to be fitted Each coefficient in , get the fitting function.
可选地,所述候选采样数据包括候选采样周期及其对应的实际数据值;Optionally, the candidate sampling data includes a candidate sampling period and its corresponding actual data value;
所述对每个所述拟合函数进行验证,并确定出候选拟合函数的步骤,包括:The step of verifying each of the fitting functions and determining the candidate fitting functions includes:
针对每个所述拟合函数,将所述多个候选采样数据代入所述拟合函数,得到每个所述候选采样周期对应的预测数据值;For each of the fitting functions, substituting the plurality of candidate sampling data into the fitting function to obtain predicted data values corresponding to each of the candidate sampling periods;
根据每个所述候选采样周期对应的预测数据值与实际数据值,计算所述拟合函数对应的方差和,其中,所述方差和指示所述拟合函数所表征的所述待监控对象的变化趋势与所述待监控对象的实际变化趋势之间的偏差大小;Calculate the variance sum corresponding to the fitting function according to the predicted data value and the actual data value corresponding to each of the candidate sampling periods, wherein the variance sum indicates the value of the object to be monitored represented by the fitting function The deviation between the change trend and the actual change trend of the object to be monitored;
根据每个所述拟合函数对应的方差和,计算每个所述拟合函数的拟合结果权值,其中,所述拟合结果权值表征所述拟合函数的拟合效果;According to the variance sum corresponding to each of the fitting functions, the fitting result weight of each of the fitting functions is calculated, wherein the fitting result weight represents the fitting effect of the fitting function;
将所述拟合结果权值最大的所述拟合函数,作为所述候选拟合函数。The fitting function with the largest weight of the fitting result is used as the candidate fitting function.
可选地,所述根据每个所述拟合函数对应的方差和,计算每个所述拟合函数的拟合结果权值的步骤,包括:Optionally, the step of calculating the fitting result weight of each fitting function according to the variance sum corresponding to each fitting function includes:
根据每个所述拟合函数对应的方差和,利用预设公式According to the sum of variances corresponding to each of the fitting functions, using a preset formula
计算每个所述拟合函数的拟合结果权值;calculating a fitting result weight of each of the fitting functions;
其中,Wij表示第i个所述拟合函数的在第j次拟合中的拟合结果权值;Wi(j-1)表示第i个所述拟合函数在第j-1次拟合中的拟合结果权值,且Wi(j-1)的初始默认值为0;sumij表示第i个所述拟合函数在第j次拟合中对应的方差和;sumtotal表示参与第j次拟合的每个所述拟合函数对应的方差和之和,n表示参与第j次拟合的所述拟合函数的个数,k表示参与第j次拟合的所述拟合函数的编号。Among them, W ij represents the fitting result weight of the i-th fitting function in the j-th fitting; W i(j-1) represents the i-th fitting function in the j-1 fitting The weight of the fitting result in the fitting, and the initial default value of W i(j-1) is 0; sum ij represents the corresponding variance sum of the i-th fitting function in the j-th fitting; sum total Indicates the sum of the variance sums corresponding to each of the fitting functions participating in the jth fitting, n represents the number of the fitting functions participating in the j-th fitting, and k represents the number of the fitting functions participating in the j-th fitting.
可选地,所述利用所述目标拟合函数,对所述待监控对象进行预警的步骤,包括:Optionally, the step of using the target fitting function to give an early warning to the object to be monitored includes:
从所述采样数据集中,获取最后一个采样数据的采样周期;Obtain the sampling period of the last sampling data from the sampling data set;
根据所述最后一个采样数据的采样周期、所述采样间隔以及预先设定的预警时间偏移量,确定未来的一个待预测采样周期;Determine a sampling period to be predicted in the future according to the sampling period of the last sampling data, the sampling interval and the preset warning time offset;
将所述待预测采样周期代入所述目标拟合函数,得到所述待监控对象在所述待预测采样周期的预测值;Substituting the to-be-predicted sampling period into the target fitting function to obtain the predicted value of the to-be-monitored object in the to-be-predicted sampling period;
若所述预测值超出预警阈值,则在预警时刻对所述待监控对象进行预警;If the predicted value exceeds the early warning threshold, an early warning is given to the object to be monitored at the early warning time;
其中,所述预警时刻在所述待预测采样周期之前,且所述预警时刻与所述待预测采样周期相差所述预警时间偏移量。Wherein, the warning time is before the to-be-predicted sampling period, and the difference between the early-warning time and the to-be-predicted sampling period is the warning time offset.
可选地,所述电子设备存储有函数库,所述函数库包括多个系统时间函数和多个扩展时间函数,所述多个扩展时间函数是系统运维人员自定义的;Optionally, the electronic device stores a function library, the function library includes multiple system time functions and multiple extended time functions, and the multiple extended time functions are customized by system operation and maintenance personnel;
所述获取待监控对象对应的函数列表的步骤,包括:The step of obtaining the function list corresponding to the object to be monitored includes:
响应选择操作,从所述函数库中获取多个所述待拟合函数,得到所述函数列表;其中,所述待拟合函数为所述系统时间函数和所述扩展时间函数中的至少一种。Responding to the selection operation, obtaining a plurality of the functions to be fitted from the function library to obtain the function list; wherein the function to be fitted is at least one of the system time function and the extended time function kind.
第二方面,本申请实施例还提供了一种数据预警装置,应用于电子设备,所述装置包括:In the second aspect, the embodiment of the present application also provides a data early warning device, which is applied to electronic equipment, and the device includes:
获取模块,用于获取待监控对象对应的函数列表,其中,所述函数列表包括多个待拟合函数,一个所述待拟合函数用于表征所述待监控对象的一种变化趋势;An acquisition module, configured to acquire a function list corresponding to the object to be monitored, wherein the function list includes a plurality of functions to be fitted, and one function to be fitted is used to represent a change trend of the object to be monitored;
拟合模块,用于基于所述待监控对象的实际数据值,对所述函数列表中的待拟合函数进行多次拟合,得到目标拟合函数;其中,所述目标拟合函数所表征的所述待监控对象的变化趋势与所述待监控对象的实际变化趋势之间的偏差最小;A fitting module, configured to perform multiple fittings on the functions to be fitted in the function list based on the actual data values of the objects to be monitored to obtain a target fitting function; wherein, the target fitting function represented by The deviation between the change trend of the object to be monitored and the actual change trend of the object to be monitored is the smallest;
预警模块,用于利用所述目标拟合函数,对所述待监控对象进行预警。The early warning module is configured to use the target fitting function to give early warning to the object to be monitored.
第三方面,本申请实施例还提供了一种电子设备,包括处理器和存储器,所述存储器用于存储程序,所述处理器用于在执行所述程序时,实现上述第一方面中的数据预警方法。In the third aspect, the embodiment of the present application also provides an electronic device, including a processor and a memory, the memory is used to store a program, and the processor is used to implement the data in the first aspect when executing the program. Early warning method.
第四方面,本申请实施例还提供了一种计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现上述第一方面中的数据预警方法。In a fourth aspect, the embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the data early warning method in the above-mentioned first aspect is implemented.
相对现有技术,本申请实施例提供的一种数据预警方法、装置、电子设备及存储介质,针对待监控对象,先获取待监控对象对应的函数列表,该函数列表包括多个待拟合函数,一个待拟合函数用于表征待监控对象的一种变化趋势;然后,基于待监控对象的实际数据值,对函数列表中的待拟合函数进行多次拟合,得到所表征的待监控对象的变化趋势与待监控对象的实际变化趋势之间的偏差最小的目标拟合函数;最后,利用目标拟合函数,对待监控对象进行预警;从而能够在故障发生前进行准确预警。Compared with the prior art, in the data early warning method, device, electronic equipment and storage medium provided by the embodiments of the present application, for the object to be monitored, the function list corresponding to the object to be monitored is first obtained, and the function list includes a plurality of functions to be fitted , a function to be fitted is used to represent a change trend of the object to be monitored; then, based on the actual data value of the object to be monitored, the function to be fitted in the function list is fitted multiple times to obtain the characterized The target fitting function with the smallest deviation between the change trend of the object and the actual change trend of the object to be monitored; finally, the target fitting function is used to give an early warning to the monitored object; thus, an accurate early warning can be given before the fault occurs.
附图说明Description of drawings
图1示出了本申请实施例提供的一种数据预警方法的流程示意图一。FIG. 1 shows a first schematic flowchart of a data early warning method provided by an embodiment of the present application.
图2示出了本申请实施例提供的一种数据预警方法的流程示意图二。FIG. 2 shows a second schematic flow diagram of a data early warning method provided by an embodiment of the present application.
图3示出了本申请实施例提供的周期性采样的示例图。FIG. 3 shows an example diagram of periodic sampling provided by the embodiment of the present application.
图4为图1和图2所示的数据预警方法中步骤S103的流程示意图。FIG. 4 is a schematic flowchart of step S103 in the data early warning method shown in FIG. 1 and FIG. 2 .
图5为图1和图2所示的数据预警方法中步骤S105的流程示意图。FIG. 5 is a schematic flowchart of step S105 in the data early warning method shown in FIG. 1 and FIG. 2 .
图6示出了本申请实施例提供的一种数据预警装置的方框示意图。Fig. 6 shows a schematic block diagram of a data early warning device provided by an embodiment of the present application.
图7示出了本申请实施例提供的一种电子设备的方框示意图。Fig. 7 shows a schematic block diagram of an electronic device provided by an embodiment of the present application.
图标:100-数据预警装置;101-获取模块;103-拟合模块;105-预警模块;104-采样模块;10-电子设备;11-处理器;12-存储器;13-总线。Icons: 100-data warning device; 101-acquisition module; 103-fitting module; 105-warning module; 104-sampling module; 10-electronic equipment; 11-processor; 12-memory; 13-bus.
具体实施方式detailed description
下面将结合本申请实施例中附图,对本申请实施例中的技术方案进行清楚、完整地描述。The following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the drawings in the embodiments of the present application.
通常,为了确保信息系统(例如,网络监控系统、网络管理系统、IT运维系统等)的平稳运行,系统运维人员会在系统上线后为其添加一系列的监控对象,并设置每一项监控对象的监控阈值,以及时观测系统的运行状态,并对可能触发的异常进行及时干预。Usually, in order to ensure the smooth operation of information systems (such as network monitoring systems, network management systems, IT operation and maintenance systems, etc.), system operation and maintenance personnel will add a series of monitoring objects to the system after it goes online, and set each item Monitor the monitoring threshold of the object to observe the operating status of the system in time and intervene in time for any abnormalities that may be triggered.
目前主要采用的监控方式是:在系统运行过程中,不断对各项监控对象进行采样,当某一项监控对象的数据采样值超过其监控阈值时进行报警。但是,由于数据采样值都是对系统的已发生状态进行采样,所以,这种方式无法通过采样数据对未来进行预判。即,只能对已经发生的故障进行报警,不能在故障发生前进行预先报警。At present, the main monitoring method is: during the operation of the system, the monitoring objects are continuously sampled, and when the data sampling value of a certain monitoring object exceeds its monitoring threshold, an alarm is issued. However, since the data sampling values are samples of the existing state of the system, this method cannot predict the future through sampling data. That is to say, the alarm can only be given to the faults that have already occurred, and the alarm cannot be given in advance before the fault occurs.
同时,通过设置监控阈值的方式在故障发生前进行预警,是非常困难的。原因在于:某一项监控对象随系统运行得到的趋势曲线是难以在系统运行前准确确定的,所以系统运维人员在设置监控阈值时,很难将监控阈值准确的设置在趋势曲线上,最终的结果便是:要么监控阈值未到便已出现系统异常,要么出现大量的误报预警。At the same time, it is very difficult to give an early warning before a fault occurs by setting a monitoring threshold. The reason is that it is difficult to accurately determine the trend curve obtained by a certain monitoring object with the system running before the system runs, so when the system operation and maintenance personnel set the monitoring threshold, it is difficult to accurately set the monitoring threshold on the trend curve, and finally The result is: either the monitoring threshold has not reached the system abnormality, or a large number of false alarms and early warnings.
因此,既要做到有效预警,又要减少不必要的预警误判,监控阈值的设置难度非常大,无法在故障发生前进行准确预警。Therefore, it is necessary to achieve effective early warning and reduce unnecessary early warning misjudgments. It is very difficult to set the monitoring threshold, and it is impossible to provide accurate early warning before the fault occurs.
为了解决上述技术问题,本申请实施例基于待监控对象的实际数据值,对待监控对象对应的函数列表中的待拟合函数进行多次拟合,其中,函数列表包括多个待拟合函数,一个待拟合函数用于表征待监控对象的一种变化趋势,得到所表征的待监控对象的变化趋势与待监控对象的实际变化趋势之间的偏差最小的目标拟合函数,再利用目标拟合函数对待监控对象进行预警,就能够在故障发生前进行准确预警。下面进行详细介绍。In order to solve the above technical problems, the embodiments of the present application perform multiple fittings on the functions to be fitted in the function list corresponding to the objects to be monitored based on the actual data values of the objects to be monitored, wherein the function list includes multiple functions to be fitted, A function to be fitted is used to represent a change trend of the object to be monitored, and the target fitting function with the smallest deviation between the change trend of the characterized change trend of the object to be monitored and the actual change trend of the object to be monitored is obtained, and then the target fitting function is used to The combination function can give early warning to the monitored object, so that the accurate warning can be given before the fault occurs. Details are given below.
本申请实施例中的电子设备,可以是服务器,例如,单个服务器、服务器集群等;也可以是终端,例如,台式电脑、笔记本电脑、智能手机、平板电脑等。本申请实施例对此不做任何限制。The electronic device in the embodiment of the present application may be a server, for example, a single server, a server cluster, etc.; it may also be a terminal, for example, a desktop computer, a notebook computer, a smart phone, a tablet computer, and the like. The embodiments of this application do not impose any limitation on this.
在本实施例中,针对信息系统,例如,网络监控系统、网络管理系统、IT运维系统等,在系统上线之前,系统运维人员可以为该系统配置监控对象库和函数库,便于后续对该系统进行监控。In this embodiment, for information systems, such as network monitoring systems, network management systems, IT operation and maintenance systems, etc., before the system goes online, the system operation and maintenance personnel can configure the monitoring object library and function library for the system to facilitate subsequent The system is monitored.
即,针对信息系统,电子设备可以预先存储有该系统的监控对象库和函数库。为便于理解,在介绍本申请实施例的具体实现之前,先对监控对象库和函数库进行介绍。That is, for the information system, the electronic device may pre-store the monitoring object library and the function library of the system. For ease of understanding, before introducing the specific implementation of the embodiment of the present application, the monitoring object library and the function library are introduced first.
监控对象库可以包括:系统运维人员为系统预先配置的,在系统运行过程中需要进行监控的各项监控对象,例如,服务时延、服务成功率、CPU占用率等。The monitoring object library may include: system operation and maintenance personnel pre-configured for the system, various monitoring objects that need to be monitored during system operation, for example, service delay, service success rate, CPU usage rate, etc.
每一项监控对象均可以包括:标识、名称、预警阈值、预警时间偏移量和采样间隔。Each monitoring object can include: ID, name, warning threshold, warning time offset and sampling interval.
其中,标识用于唯一标识一个用于采样的监控对象。名称用于描述监控对象。预警阈值是指可能引发系统异常的监控对象的数据值。采样间隔是指对监控对象的实际数据值进行两次采样的时间间隔。Wherein, the identifier is used to uniquely identify a monitoring object used for sampling. The name is used to describe the monitoring object. The early warning threshold refers to the data value of the monitoring object that may cause system exceptions. The sampling interval refers to the time interval between sampling the actual data value of the monitored object twice.
预警时间偏移量是指监控对象发生偏离趋势的提前预警时间。例如,针对一项监控对象,通过本申请实施例提供的数据预警方法,预判出当天16:00会发生异常,假如预警时间偏移量是30min,则在当天15:30会进行报警,从而为系统运维人员预留可控的异常干预时间。The early warning time offset refers to the early warning time when the monitored object deviates from the trend. For example, for a monitoring object, through the data early warning method provided by the embodiment of the present application, it is predicted that an abnormality will occur at 16:00 on the same day. If the early warning time offset is 30 minutes, an alarm will be issued at 15:30 on the same day, thereby Reserve controllable abnormal intervention time for system operation and maintenance personnel.
函数库可以包括多个系统时间函数,一个系统时间函数用于表征监控对象的一种变化趋势。The function library may include multiple system time functions, and one system time function is used to represent a change trend of the monitored object.
需要指出的是,函数库中的各个系统时间函数,不是确定的函数,而是确定的函数模板。也就是,函数的表达式是确定的,但函数中的各个系数是未知的,需要根据实际的监控需求求解具体的系数。It should be pointed out that each system time function in the function library is not a definite function, but a definite function template. That is, the expression of the function is definite, but each coefficient in the function is unknown, and specific coefficients need to be solved according to actual monitoring requirements.
可选地,函数库中的系统时间函数可以包括,但不限于标准线性函数、标准多项式函数等。其中,标准线性函数用于表征监控对象的平稳变化趋势,标准多项式函数用于表征监控对象的剧烈变化趋势。标准线性函数和标准多项式函数的函数表达式如下:Optionally, the system time functions in the function library may include, but not limited to, standard linear functions, standard polynomial functions, and the like. Among them, the standard linear function is used to represent the steady change trend of the monitored object, and the standard polynomial function is used to represent the drastic change trend of the monitored object. The function expressions for standard linear functions and standard polynomial functions are as follows:
标准线性函数:f(t)=a0+a1*tStandard linear function: f(t)=a 0 +a 1 *t
标准多项式函数:f(t)=a0+a1*t+a2*t2+…+an*tn+1(n>1)Standard polynomial function: f(t)=a 0 +a 1 *t+a 2 *t 2 +…+a n *t n+1 (n>1)
在一种可能的实现方式中,函数库中的每个系统时间函数,可以均包括:函数标识、函数表达式、默认参数和函数拟合方式。In a possible implementation manner, each system time function in the function library may include: a function identifier, a function expression, a default parameter, and a function fitting method.
其中,函数标识是一个字符串,用于在函数库中标识一个唯一的系统时间函数。Wherein, the function identifier is a character string used to identify a unique system time function in the function library.
函数表达式用于系统运维人员选择对应的系统时间函数,例如,上述所示的标准线性函数的函数表达式、标准多项式函数的函数表达式等。The function expression is used by the system operation and maintenance personnel to select the corresponding system time function, for example, the function expression of the standard linear function and the function expression of the standard polynomial function shown above.
默认参数是指系统时间函数的初始配置参数,例如,上述标准多项式函数中的项数n的值等。The default parameters refer to the initial configuration parameters of the system time function, for example, the value of the number of items n in the above-mentioned standard polynomial function, etc.
函数拟合方式是指预先为系统时间函数配置的拟合方式,也就是求解系统时间函数中具体系数的方式,例如,最小二乘法。即,可以通过最小二乘法实现系统时间函数的系数求解计算,获得系统时间函数中的各个系数值。The function fitting method refers to the fitting method configured for the system time function in advance, that is, the method of solving specific coefficients in the system time function, for example, the least square method. That is, the coefficient calculation of the system time function can be realized by the least square method, and each coefficient value in the system time function can be obtained.
在一种可能的情形下,实际应用中,系统提供的函数库可能无法满足特定的监控需求,这种情况下,系统运维人员还可以根据实际的监控需求自定义扩展时间函数,并将自定义的各个扩展时间函数加入函数库,便于在后续监控中从函数库中进行选择。一个扩展时间函数用于表征监控对象的一种变化趋势。In a possible situation, in actual applications, the function library provided by the system may not meet the specific monitoring requirements. In this case, system operation and maintenance personnel can also customize the extended time function according to the actual monitoring requirements, and automatically Each defined extended time function is added to the function library, which is convenient for selection from the function library in subsequent monitoring. An extended time function is used to characterize a change trend of the monitored object.
与系统时间函数一样,这里系统运维人员自定义的各个扩展时间函数,也不是确定的函数,而是确定的函数模板。即,函数的表达式是确定的,但函数中的各个系数是未知的,需要根据实际的监控需求求解具体的系数。Like the system time function, the various extended time functions customized by the system operation and maintenance personnel here are not definite functions, but definite function templates. That is, the expression of the function is definite, but each coefficient in the function is unknown, and specific coefficients need to be solved according to actual monitoring requirements.
可选地,扩展时间函数可以包括:函数标识、函数表达式、系数偏导函数组、系数猜测值和函数拟合方式。Optionally, the extended time function may include: a function identifier, a function expression, a coefficient partial derivative function group, a coefficient guess value, and a function fitting method.
其中,函数标识是一个字符串,用于在函数库中标识一个唯一的扩展时间函数。Wherein, the function identifier is a character string used to identify a unique extended time function in the function library.
函数表达式是系统运维人员自定义的,也是一个字符串,用于描述扩展时间函数的求值计算公式。The function expression is customized by the system operation and maintenance personnel, and it is also a string, which is used to describe the evaluation calculation formula of the extended time function.
系数偏导函数组是一个字符串数组,用于描述针对扩展时间函数中每个系数的偏导计算公式。The coefficient partial derivative function group is an array of strings describing the partial derivative calculation formula for each coefficient in the extended time function.
系数猜测值是一个浮点数值数组,用于梯度下降法计算扩展时间函数系数时的系数初始值。The coefficient guess value is an array of floating point values, which is used for the initial value of the coefficient when the gradient descent method calculates the coefficient of the extended time function.
函数拟合方式是指扩展时间函数的拟合方式,也就是求解扩展时间函数中具体系数的方式,例如,梯度下降法。即,可以通过梯度下降法实现系数逼近求解计算,获得扩展时间函数中的各个系数值。The function fitting method refers to the fitting method of the extended time function, that is, the method of solving the specific coefficients in the extended time function, for example, the gradient descent method. That is, the coefficient approximation calculation can be realized by the gradient descent method, and each coefficient value in the extended time function can be obtained.
需要指出的是,上述扩展时间函数的函数表达式和扩展时间函数中每个系数的偏导计算公式,均为一个算术表达式,表达式可以包括系数、函数自变量、运算符等。It should be pointed out that the above-mentioned function expression of the extended time function and the partial derivative calculation formula of each coefficient in the extended time function are both an arithmetic expression, and the expression may include coefficients, function arguments, operators, etc.
其中,系数可以用ai(i≥0)的方式表示,例如,扩展时间函数可以包括多个系数,可以用a0、a1、a2…分别表示各个系数。Wherein, the coefficients may be represented by a i (i≥0). For example, the extended time function may include multiple coefficients, and each coefficient may be represented by a 0 , a 1 , a 2 . . . respectively.
同时,由于本申请实施例中涉及的系统时间函数和扩展时间函数都对应时间函数,所以,函数自变量固定为t。Meanwhile, since the system time function and the extended time function involved in the embodiment of the present application both correspond to time functions, the function argument is fixed as t.
运算符可以包括普通运算符,例如,+、-、*、/、括号等,其中,括号允许在表达式中嵌套使用。运算符也可以包括函数运算符,例如,Math.abs(x)、Math.pow(x,y)、Math.log(x)、Math.sin(x)、Math.cos(x)、Math.tan(x)等,其中,abs是求x的绝对值函数,pow是求x的y次幂函数,log是求x的对数函数,sin是求x的正弦函数,cos是求x的余弦函数,tan是求x的正切函数。Operators may include common operators, such as +, -, *, /, parentheses, etc., where parentheses allow nesting in expressions. Operators can also include functional operators, for example, Math.abs(x), Math.pow(x,y), Math.log(x), Math.sin(x), Math.cos(x), Math. tan(x), among them, abs is the absolute value function of x, pow is the y power function of x, log is the logarithmic function of x, sin is the sine function of x, cos is the cosine of x function, tan is the tangent function of x.
可选地,系统运维人员自定义的扩展时间函数可以包括,但不限于指数函数、对数函数、混合函数等。指数函数、对数函数、混合函数均用于表征监控对象的剧烈变化趋势。指数函数、对数函数、混合函数的函数表达式、系数偏导函数组和系数猜测值如下:Optionally, the extended time function defined by the system operation and maintenance personnel may include, but not limited to, an exponential function, a logarithmic function, a mixed function, and the like. Exponential function, logarithmic function, and mixed function are all used to characterize the drastic change trend of the monitored object. The function expression of exponential function, logarithmic function, mixed function, coefficient partial derivative function group and coefficient guess value are as follows:
1、指数函数1. Exponential function
函数表达式:f(t)=a0*Math.pow(a1,t)Function expression: f(t)=a 0 *Math.pow(a 1 ,t)
系数偏导函数组:Coefficient partial derivative function set:
Fa0=Math.pow(a1,t)Fa 0 =Math.pow(a 1 ,t)
Fa1=a0*Math.pow(a1,(t-1))*tFa 1 =a 0 *Math.pow(a 1 ,(t-1))*t
系数猜测值:{5.0,1.0}。即,a0和a1的初始值分别为5.0和1.0。Coefficient guess: {5.0, 1.0}. That is, the initial values of a 0 and a 1 are 5.0 and 1.0, respectively.
2、对数函数2. Logarithmic function
函数表达式:f(t)=a0*Math.log(a1*t)+a2 Function expression: f(t)=a 0 *Math.log(a 1 *t)+a 2
系数偏导函数组:Coefficient partial derivative function set:
Fa0=Math.log(t)+Math.log(a1)Fa 0 =Math.log(t)+Math.log(a 1 )
Fa1=a0/a1 Fa 1 =a 0 /a 1
Fa2=1Fa 2 =1
系数猜测值:{1.0,1.0,0.8}。即,a0、a1和a2的初始值分别为1.0、1.0和0.8。Coefficient guess value: {1.0, 1.0, 0.8}. That is, the initial values of a 0 , a 1 and a 2 are 1.0, 1.0 and 0.8, respectively.
3、混合函数3. Mixed function
函数表达式:f(t)=a0+a1/(a2+Math.pow(t,a3))Function expression: f(t)=a 0 +a 1 /(a 2 +Math.pow(t,a 3 ))
系数偏导函数组:Coefficient partial derivative function set:
Fa0=1Fa 0 =1
Fa1=1/(Math.pow(t,a3)+a2)Fa 1 =1/(Math.pow(t,a 3 )+a 2 )
Fa2=-a1/(Math.pow(t,(2*a3))+(2*a2*Math.pow(t,a3)+Math.pow(a2,2))Fa 2 =-a 1 /(Math.pow(t,(2*a 3 ))+(2*a 2 *Math.pow(t,a 3 )+Math.pow(a 2 ,2))
Fa3=-(a1*Math.pow(t,a3)*Math.log(t))/(Math.pow(t,(2*a3))+2*a2*Math.pow(t,a3))+Math.pow(a2,2))Fa 3 =-(a 1 *Math.pow(t,a 3 )*Math.log(t))/(Math.pow(t,(2*a 3 ))+2*a 2 *Math.pow( t,a 3 ))+Math.pow(a 2 ,2))
系数猜测值:{5.0,2.0,1.0,1.0}。即,a0、a1、a2和a3的初始值分别为5.0、2.0,1.0和1.0。Coefficient guesses: {5.0, 2.0, 1.0, 1.0}. That is, the initial values of a 0 , a 1 , a 2 and a 3 are 5.0, 2.0, 1.0 and 1.0, respectively.
下面结合前述介绍的监控对象库和函数库,对本申请实施例的具体实现进行详细介绍。The specific implementation of the embodiment of the present application will be introduced in detail below in combination with the monitoring object library and function library introduced above.
请参照图1,图1示出了本申请实施例提供的数据预警方法的流程示意图。该数据预警方法应用于电子设备,可以包括以下步骤:Please refer to FIG. 1 , which shows a schematic flowchart of a data early warning method provided by an embodiment of the present application. The data early warning method is applied to electronic equipment, and may include the following steps:
S101,获取待监控对象对应的函数列表,其中,函数列表包括多个待拟合函数,一个待拟合函数用于表征待监控对象的一种变化趋势。S101. Obtain a function list corresponding to an object to be monitored, wherein the function list includes a plurality of functions to be fitted, and one function to be fitted is used to represent a change trend of the object to be monitored.
在本实施例中,待监控对象可以是监控对象库中的任意一项监控对象,例如,CPU占用率。需要指出的是,本申请实施例中是为了便于理解,以任意一项待监控对象为例进行说明,并不是说只监控待监控对象。可以理解地,在系统运行过程中,会对监控对象库中的每一项监控对象均进行监控,待监控对象可以是这些监控对象中的任一项。In this embodiment, the object to be monitored may be any monitored object in the monitored object library, for example, CPU usage. It should be pointed out that, in the embodiment of the present application, any object to be monitored is taken as an example for illustration, and it does not mean that only the object to be monitored is monitored. It can be understood that during the running of the system, each monitoring object in the monitoring object library will be monitored, and the object to be monitored can be any one of these monitoring objects.
从前述内容可知,电子设备存储有函数库,函数库包括多个系统时间函数和多个扩展时间函数,扩展时间函数是系统运维人员自定义的,因此,步骤S101中获取待监控对象对应的函数列表的过程,可以包括:From the foregoing, it can be seen that the electronic device stores a function library, and the function library includes multiple system time functions and multiple extended time functions. The extended time function is customized by the system operation and maintenance personnel. The process of function list can include:
响应选择操作,从函数库中获取多个待拟合函数,得到函数列表;其中,待拟合函数为系统时间函数和扩展时间函数中的至少一种。In response to the selection operation, multiple functions to be fitted are acquired from the function library to obtain a function list; wherein, the functions to be fitted are at least one of a system time function and an extended time function.
在本实施例中,函数库中的一个时间函数用于表征监控对象的一种变化趋势,但是,在实际中,针对待监控对象,系统运维人员事先可能无法预估待监控对象的变化趋势。因此,系统运维人员可以从函数库中选择多个时间函数,并将选择的每一个时间函数均作为待拟合函数。In this embodiment, a time function in the function library is used to represent a change trend of the monitored object. However, in practice, for the object to be monitored, the system operation and maintenance personnel may not be able to predict the change trend of the object to be monitored in advance . Therefore, system operation and maintenance personnel can select multiple time functions from the function library, and use each selected time function as a function to be fitted.
相应地,选择操作是指系统运维人员从函数库中选择时间函数的操作,将系统运维人员选择的每一个时间函数均作为待拟合函数,最终得到待监控对象的函数列表。Correspondingly, the selection operation refers to the operation that the system operation and maintenance personnel select the time function from the function library, and each time function selected by the system operation and maintenance personnel is used as a function to be fitted, and finally a function list of objects to be monitored is obtained.
可以理解地,函数列表中的多个待拟合函数,可以均为系统时间函数,也可以均为扩展时间函数,还可以是系统时间函数和扩展时间函数的组合。系统运维人员可以根据待监控对象可能的变化趋势灵活选择待拟合函数,本申请实施例对此不做任何限制。Understandably, the functions to be fitted in the function list may all be system time functions, all may be extended time functions, or may be a combination of system time functions and extended time functions. The system operation and maintenance personnel can flexibly select the function to be fitted according to the possible change trend of the object to be monitored, which is not limited in this embodiment of the present application.
S103,基于待监控对象的实际数据值,对函数列表中的待拟合函数进行多次拟合,得到目标拟合函数;其中,目标拟合函数所表征的待监控对象的变化趋势与待监控对象的实际变化趋势之间的偏差最小。S103, based on the actual data value of the object to be monitored, perform multiple fittings on the function to be fitted in the function list to obtain the target fitting function; wherein, the change trend of the object to be monitored represented by the target fitting function is related to the The deviation between the actual change trends of the objects is minimal.
在本实施例中,在确定待监控对象的函数列表之后,基于待监控对象的实际数据值,对待监控对象对应的函数列表中的待拟合函数进行多次拟合。也就是,由于待拟合函数是函数模板,其中的系数是未知的,所以,要基于待监控对象的实际数据值,求解函数列表中每个待拟合函数中的各项系数,这一工程即为对待拟合函数进行拟合。In this embodiment, after the function list of the object to be monitored is determined, the functions to be fitted in the function list corresponding to the object to be monitored are fitted multiple times based on the actual data value of the object to be monitored. That is, since the function to be fitted is a function template, the coefficients in it are unknown, so it is necessary to solve the coefficients of each function to be fitted in the function list based on the actual data value of the object to be monitored. That is, to fit the function to be fitted.
由于函数列表多个待拟合函数,一个待拟合函数用于表征待监控对象的一种变化趋势,因此,需要对函数列表中的待拟合函数进行多次拟合,直至从中选出一个所表征的待监控对象的变化趋势与待监控对象的实际变化趋势之间的偏差最小的目标拟合函数。需要指出的是,这里的目标拟合函数,与待拟合函数不同,它是确定的函数,即,目标拟合函数中的各个系数都是已知的。Since there are multiple functions to be fitted in the function list, one function to be fitted is used to represent a change trend of the object to be monitored. Therefore, it is necessary to perform multiple fittings on the functions to be fitted in the function list until one of them is selected. The target fitting function with the smallest deviation between the characteristic change trend of the object to be monitored and the actual change trend of the object to be monitored. It should be pointed out that the target fitting function here is different from the function to be fitted, and it is a definite function, that is, each coefficient in the target fitting function is known.
S105,利用目标拟合函数,对待监控对象进行预警。S105, using the target fitting function to give an early warning to the object to be monitored.
在本实施例中,通过步骤S102确定出目标拟合函数之后,就能利用目标拟合函数,对待监控对象进行预警。即,利用目标拟合函数,预测待监控对象可能会出现异常的时间,并提前进行预警。In this embodiment, after the target fitting function is determined through step S102, the target fitting function can be used to give an early warning to the object to be monitored. That is, use the target fitting function to predict the time when the object to be monitored may appear abnormal, and give an early warning.
同时,由于目标拟合函数所表征的待监控对象的变化趋势与待监控对象的实际变化趋势之间的偏差最小,所以,能确保预警的准确度,从而能够在故障发生前进行准确预警。At the same time, since the deviation between the change trend of the object to be monitored represented by the target fitting function and the actual change trend of the object to be monitored is the smallest, the accuracy of the early warning can be ensured, so that an accurate early warning can be carried out before the fault occurs.
从前述内容可知,要根据待监控对象的实际数据值,对函数列表中的待拟合函数进行拟合,则必然要对待监控对象的实际数据值进行采样。即,本申请实施例提供的数据预警方法,除了步骤S103中的函数拟合过程、以及步骤S105中的预警过程之外,还包括实际数据值的采样过程。It can be seen from the foregoing that, in order to fit the functions to be fitted in the function list according to the actual data values of the objects to be monitored, it is necessary to sample the actual data values of the objects to be monitored. That is, the data early warning method provided by the embodiment of the present application, in addition to the function fitting process in step S103 and the early warning process in step S105, also includes a sampling process of actual data values.
因此,在图1的基础上,请参照图2,本申请实施例提供的数据预警方法,还包括步骤S102~S104。Therefore, on the basis of FIG. 1 , please refer to FIG. 2 , the data early warning method provided by the embodiment of the present application further includes steps S102-S104.
S102,按照预先设定的采样间隔,周期性采样待监控对象的实际数据值。S102. Periodically sample the actual data value of the object to be monitored according to a preset sampling interval.
S104,针对每个采样周期,将采样周期及其对应的实际数据值作为一个采样数据,加到预先构建的采样数据集中。S104. For each sampling period, add the sampling period and its corresponding actual data value as a sampling data to the pre-built sampling data set.
在本实施例中,可以按照监控对象库中定义的采样间隔,对待监控对象的实际数据值进行周期性采样。每个采样周期,可以是每次采样的时间,采样周期即为前述介绍的系统时间函数和扩展时间函数中的t。In this embodiment, the actual data value of the object to be monitored can be periodically sampled according to the sampling interval defined in the monitored object library. Each sampling period may be the time of each sampling, and the sampling period is t in the system time function and extended time function introduced above.
如图3所示,t1、t2、t3分别表示第1个采样周期、第2个采样周期、第3个采样周期,也即,对待监控对象的实际数据值进行第1次采样、第2次采样、第3次采样。每个采样周期都能采样到待监控对象的实际数据值,每一次采样后,将当前采样周期和当次采样到的实际数据值作为一个采样数据,加到预先构建的采样数据集中。采样数据集中的每一个采样数据,都可以用(ti,yi)进行表示,ti表示采样周期,yi表示实际数据值。As shown in Figure 3, t1, t2, and t3 respectively represent the first sampling period, the second sampling period, and the third sampling period, that is, the first sampling and the second sampling of the actual data value of the object to be monitored Sample, 3rd sample. Each sampling period can sample the actual data value of the object to be monitored. After each sampling, the current sampling period and the actual data value sampled at that time are taken as a sampling data and added to the pre-built sampling data set. Each sampling data in the sampling data set can be represented by (t i , y i ), where t i represents the sampling period, and y i represents the actual data value.
可选地,针对待监控对象,当前采样周期可以通过以下公式进行确定:Optionally, for the object to be monitored, the current sampling period can be determined by the following formula:
其中,ti表示当前采样周期,Tm表示当前系统时间,T0表示待监控对象的首次采样时间,Δt表示采样间隔。Among them, t i represents the current sampling period, T m represents the current system time, T 0 represents the first sampling time of the object to be monitored, and Δt represents the sampling interval.
需要指出的是,步骤S102~S104中的实际数据值的采样过程,和步骤S103中的函数拟合过程,是互相独立的两个过程,二者是并列进行的。It should be pointed out that the sampling process of actual data values in steps S102-S104 and the function fitting process in step S103 are two independent processes, and the two processes are performed in parallel.
下面对步骤S103进行详细介绍。Step S103 will be described in detail below.
在图2的基础上,请参照图4,步骤S103可以包括S1031~S1035。On the basis of FIG. 2 , please refer to FIG. 4 , step S103 may include S1031-S1035.
S1031,从采样数据集中,获取最后一个采样数据及其之前设定数目个采样数据,得到多个候选采样数据。S1031. Obtain the last sampled data and a set number of sampled data before it from the sampled data set to obtain a plurality of candidate sampled data.
在本实施例中,由于实际数据值的采样是独立于函数拟合过程存在的,并且实际数据值是按照采样间隔周期性采样的,即,采样数据集中的采样数据是不断增加的。因此,为了确保后续预警的准确性,在每次对函数列表中的待拟合函数进行拟合时,都要从采样数据集中获取最后一个采样数据及其之前的m个采样数据,m的具体数值可以由系统运维人员根据实际需求灵活设置,本申请实施例对此不做任何限制。In this embodiment, since the sampling of the actual data values is independent of the function fitting process, and the actual data values are periodically sampled according to the sampling interval, that is, the sampled data in the sampled data set is constantly increasing. Therefore, in order to ensure the accuracy of subsequent early warnings, each time the function to be fitted in the function list is fitted, the last sampled data and the m sampled data before it must be obtained from the sampled data set. The specific value of m The value can be flexibly set by system operation and maintenance personnel according to actual needs, and this embodiment of the present application does not impose any limitation on this.
可选地,还可以预先配置设定长度的数据队列,并将每次用于拟合的多个候选采样数据加入到数据队列中,后续即可直接根据数据队列对函数列表中的待拟合函数进行拟合。Optionally, a data queue with a set length can also be pre-configured, and multiple candidate sampling data for fitting each time can be added to the data queue, and then the data to be fitted in the function list can be directly adjusted according to the data queue function to fit.
可以理解地,针对待监控对象,在第1次对函数列表中的待拟合函数进行拟合时,数据队列可能是空的,所以,需要从采样数据集中获取最后一个采样数据及其之前的m个采样数据加入到数据队列中;而从第2次函数拟合开始,为了避免数据重复同时提高拟合效率,只需要从采样数据集中获取最后一个采样数据加入到数据队列中。Understandably, for the object to be monitored, when the function to be fitted in the function list is fitted for the first time, the data queue may be empty, so it is necessary to obtain the last sampled data and its previous ones from the sampled data set m sampling data are added to the data queue; and from the second function fitting, in order to avoid data duplication and improve fitting efficiency, only the last sampling data needs to be obtained from the sampling data set and added to the data queue.
可选地,将采样数据集中的最后一个采样数据加入到数据队列中的过程,可以包括:Optionally, the process of adding the last sampled data in the sampled data set to the data queue may include:
判断数据队列是否达到设定长度;Determine whether the data queue reaches the set length;
若否,则将采样数据集中的最后一个采样数据加到数据队列的队尾;If not, add the last sample data in the sample data set to the end of the data queue;
若是,则对数据队列中的队首数据进行出队操作后,再将采样数据集中的最后一个采样数据加到数据队列的队尾。If so, after dequeuing the head data in the data queue, add the last sampled data in the sampled data set to the tail of the data queue.
S1032,根据多个候选采样数据,对函数列表中的每个待拟合函数进行拟合,得到每个拟合函数。S1032. Fit each function to be fitted in the function list according to the plurality of candidate sampling data to obtain each fitted function.
在本实施例中,在每次对函数列表中的待拟合函数进行拟合时,可以直接从采样数据集中获取最后一个采样数据及其之前的m个采样数据进行拟合,也可以根据前述的数据队列进行拟合。In this embodiment, each time the function to be fitted in the function list is fitted, the last sampled data and the m sampled data before it can be obtained directly from the sampled data set for fitting, or it can be fitted according to the aforementioned data set for fitting.
在拟合过程中,可以将多个候选采样数据转换成一个二项式(t,y)数组,其中,t为采样周期,y为实际数据值,再根据该二项式(t,y)数组对函数列表中的每个待拟合函数进行拟合。In the fitting process, multiple candidate sampling data can be converted into a binomial (t, y) array, where t is the sampling period, y is the actual data value, and then according to the binomial (t, y) array fits each function to be fitted in the function list.
从前述内容可知,函数列表中的多个待拟合函数,可以是系统时间函数、或者扩展时间函数、或者系统时间函数和扩展时间函数的组合。针对系统时间函数,可以通过最小二乘法求解系统时间函数的各个系数。针对扩展时间函数,可以根据扩展时间函数的系数偏导函数组和系数猜测值,通过梯度下降法逼近求解扩展时间函数的各个系数。It can be seen from the foregoing that the multiple functions to be fitted in the function list may be system time functions, or extended time functions, or a combination of system time functions and extended time functions. For the system time function, each coefficient of the system time function can be solved by the least square method. For the extended time function, each coefficient of the extended time function can be approximated and solved by the gradient descent method according to the coefficient partial derivative function group of the extended time function and the guessed value of the coefficient.
因此,S1032中根据多个候选采样数据,对函数列表中的每个待拟合函数进行拟合,得到每个拟合函数的过程,可以包括:Therefore, in S1032, according to multiple candidate sampling data, each function to be fitted in the function list is fitted, and the process of obtaining each fitted function may include:
针对每个待拟合函数,若待拟合函数为系统时间函数,则根据多个候选采样数据,利用最小二乘法求解待拟合函数中的各个系数,得到拟合函数;For each function to be fitted, if the function to be fitted is a system time function, then according to multiple candidate sampling data, the least square method is used to solve each coefficient in the function to be fitted to obtain the fitted function;
若待拟合函数为扩展时间函数,则根据多个候选采样数据、以及扩展时间函数的系数偏导函数组和系数猜测值,利用梯度下降法求解待拟合函数中的各个系数,得到拟合函数。If the function to be fitted is an extended time function, then use the gradient descent method to solve each coefficient in the function to be fitted according to multiple candidate sampling data, the coefficient partial derivative function group and the coefficient guess value of the extended time function, and obtain the fitting function.
也就是,若待拟合函数为系统时间函数,则根据最小二乘法,将二项式(t,y)数组代入系数方程组,求解方程组中各个系数值[a0,a1,…,ak]。若待拟合函数为扩展时间函数,则根据梯度下降法进行迭代运算,逼近求解扩展时间函数中的各个系数值[a0,a1,…,ak]。That is, if the function to be fitted is a system time function, then according to the least square method, the binomial (t, y) array is substituted into the coefficient equation system, and each coefficient value [a 0 ,a 1 ,…, a k ]. If the function to be fitted is an extended time function, an iterative operation is performed according to the gradient descent method to approximate and solve each coefficient value [a 0 , a 1 ,…, a k ] in the extended time function.
需要指出的是,这里的拟合函数,也就是求解出待拟合函数中的各个系数之后,再将各个系数代入到待拟合函数所得到的函数表达式。It should be pointed out that the fitting function here is the function expression obtained by solving each coefficient in the function to be fitted, and then substituting each coefficient into the function to be fitted.
例如,待拟合函数为:f(t)=a0+a1*t,求解得到a0=1、a1=2,则获得的拟合函数为:f(t)=1+2t。For example, the function to be fitted is: f(t)=a 0 +a 1 *t, and a 0 =1 and a 1 =2 are obtained through solution, then the obtained fitting function is: f(t)=1+2t.
S1033,对每个拟合函数进行验证,并确定出候选拟合函数;其中,候选拟合函数所表征的所述待监控对象的变化趋势与待监控对象的实际变化趋势之间的偏差最大。S1033, verify each fitting function, and determine a candidate fitting function; wherein, the deviation between the change trend of the object to be monitored represented by the candidate fitting function and the actual change trend of the object to be monitored is the largest.
在本实施例中,候选采样数据可以包括候选采样周期及其对应的实际数据值。In this embodiment, the candidate sampling data may include candidate sampling periods and their corresponding actual data values.
可选地,对每个拟合函数进行验证,并确定出候选拟合函数的过程,可以包括S10331~S10334。Optionally, the process of verifying each fitting function and determining a candidate fitting function may include S10331-S10334.
S10331,针对每个拟合函数,将多个候选采样数据代入拟合函数,得到每个候选采样周期对应的预测数据值。S10331. For each fitting function, substitute a plurality of candidate sampling data into the fitting function to obtain a predicted data value corresponding to each candidate sampling period.
即,通过S1032得到每个拟合函数之后,以任意一个拟合函数为例,将每个候选采样周期t代入该拟合函数,计算每个候选采样周期对应的预测数据值,即f(t)的值。That is, after each fitting function is obtained through S1032, taking any fitting function as an example, each candidate sampling period t is substituted into the fitting function, and the predicted data value corresponding to each candidate sampling period is calculated, namely f(t ) value.
S10332,根据每个候选采样周期对应的预测数据值与实际数据值,计算拟合函数对应的方差和,其中,方差和指示拟合函数所表征的待监控对象的变化趋势与待监控对象的实际变化趋势之间的偏差大小。S10332. Calculate the variance sum corresponding to the fitting function according to the predicted data value and the actual data value corresponding to each candidate sampling period, where the variance sum indicates the variation trend of the object to be monitored represented by the fitting function and the actual value of the object to be monitored. The magnitude of the deviation between trends.
以任意一个拟合函数为例,利用该拟合函数,计算出每个候选采样周期对应的预测数据值之后,通过公式计算拟合函数对应的方差和,其中,f(ti)表示第i个候选采样周期对应的预测数据值,yi表示第i个候选采样周期对应的实际数据值。Taking any fitting function as an example, after using the fitting function to calculate the predicted data value corresponding to each candidate sampling period, use the formula Calculate the variance sum corresponding to the fitting function, where f(t i ) represents the predicted data value corresponding to the i-th candidate sampling period, and y i represents the actual data value corresponding to the i-th candidate sampling period.
由于拟合函数表征待监控对象的变化趋势,所以,方差值表征该拟合函数所表征的待监控对象的变化趋势与待监控对象的实际变化趋势之间的偏差大小。方差值越大,拟合函数所表征的待监控对象的变化趋势与待监控对象的实际变化趋势之间的偏差越大;方差值越小,拟合函数所表征的待监控对象的变化趋势与待监控对象的实际变化趋势之间的偏差越小。Since the fitting function represents the change trend of the object to be monitored, the variance value represents the deviation between the change trend of the object to be monitored represented by the fitting function and the actual change trend of the object to be monitored. The larger the variance value, the greater the deviation between the change trend of the object to be monitored represented by the fitting function and the actual change trend of the object to be monitored; the smaller the variance value, the greater the deviation between the change trend of the object to be monitored represented by the fitting function. The smaller the deviation between the trend and the actual change trend of the object to be monitored.
S10333,根据每个拟合函数对应的方差和,计算每个拟合函数的拟合结果权值,其中,拟合结果权值表征拟合函数的拟合效果。S10333. Calculate the fitting result weight of each fitting function according to the variance sum corresponding to each fitting function, wherein the fitting result weight represents the fitting effect of the fitting function.
在本实施例中,计算出每个拟合函数对应的方差和之后,可以根据每个拟合函数对应的方差和,计算每个拟合函数的拟合结果权值。拟合结果权值表征拟合函数的拟合效果,拟合结果权值越大,拟合函数的拟合效果越差;拟合结果权值越小,拟合函数的拟合效果越好。In this embodiment, after the variance sum corresponding to each fitting function is calculated, the fitting result weight of each fitting function may be calculated according to the variance sum corresponding to each fitting function. The weight of the fitting result represents the fitting effect of the fitting function. The larger the weight of the fitting result, the worse the fitting effect of the fitting function; the smaller the weight of the fitting result, the better the fitting effect of the fitting function.
可选地,根据每个拟合函数对应的方差和,计算每个拟合函数的拟合结果权值的过程,包括:Optionally, the process of calculating the fitting result weight of each fitting function according to the variance sum corresponding to each fitting function includes:
根据每个拟合函数对应的方差和,利用预设公式According to the variance sum corresponding to each fitting function, use the preset formula
计算每个拟合函数的拟合结果权值;Calculate the fitting result weight of each fitting function;
其中,Wij表示第i个拟合函数的在第j次拟合中的拟合结果权值;Wi(j-1)表示第i个拟合函数在第j-1次拟合中的拟合结果权值,且Wi(j-1)的初始默认值为0;sumij表示第i个拟合函数在第j次拟合中对应的方差和;sumtotal表示参与第j次拟合的每个拟合函数对应的方差和之和,n表示参与第j次拟合的拟合函数的个数,k表示参与第j次拟合的拟合函数的编号。Among them, W ij represents the fitting result weight of the i-th fitting function in the j-th fitting; W i(j-1) represents the weight of the i-th fitting function in the j-1 fitting The weight of the fitting result, and the initial default value of W i(j-1) is 0; sum ij represents the variance sum corresponding to the i-th fitting function in the j-th fitting; sum total represents the participation in the j-th fitting The sum of variances corresponding to each fitting function of the fit, n represents the number of fitting functions participating in the j-th fitting, and k represents the number of the fitting function participating in the j-th fitting.
S10334,将拟合结果权值最大的拟合函数,作为候选拟合函数。S10334. Use the fitting function with the largest fitting result weight as a candidate fitting function.
需要指出的是,S1032中对每个待拟合函数进行拟合的过程、以及S1033中对每个拟合函数进行验证的过程,可以并发执行,从而可以缩短多维度拟合计算的时间,确保预警的及时性。It should be pointed out that the process of fitting each function to be fitted in S1032 and the process of verifying each fitting function in S1033 can be executed concurrently, thereby shortening the time for multidimensional fitting calculation and ensuring Timeliness of early warning.
S1034,从函数列表中移除候选拟合函数对应的待拟合函数。S1034. Remove the function to be fitted corresponding to the candidate fitting function from the function list.
在本实施例中,由于拟合结果权值越大,拟合函数的拟合效果越差;拟合结果权值越小,拟合函数的拟合效果越好。因此,在当次拟合中,需要找出拟合结果权值最大的候选拟合函数,并将候选拟合函数对应的待拟合函数从函数列表中删除,这样的话,该待拟合函数将不会再参与下一次的拟合。In this embodiment, since the greater the weight of the fitting result, the worse the fitting effect of the fitting function is; the smaller the weight of the fitting result is, the better the fitting effect of the fitting function is. Therefore, in the current fitting, it is necessary to find out the candidate fitting function with the largest fitting result weight, and delete the function to be fitted corresponding to the candidate fitting function from the function list. In this case, the function to be fitted Will not participate in the next fitting.
可选地,监控对象库中的每一项监控对象,还可以包括拟合间隔。拟合间隔是指对监控对象对应的函数列表中的待拟合函数进行两次拟合的时间间隔。即,在完成一次拟合后,等待拟合间隔后,再进行下一次拟合。Optionally, each monitoring object in the monitoring object library may also include a fitting interval. The fitting interval refers to the time interval between two fittings of the function to be fitted in the function list corresponding to the monitoring object. That is, after one fitting is completed, wait for the fitting interval before proceeding to the next fitting.
需要指出的是,上述S1031~S1034是对函数列表中的待拟合函数进行一次拟合的过程,在进行完一次拟合(即,执行完S1034)之后,可以检测函数列表中待拟合函数的个数是否为1,如果不为1,则需要继续进行后续再次拟合,即,重复执行S1031~S1034,直至函数列表中仅剩一个待拟合函数;如果为1,则停止后续再次拟合,并将函数列表中仅剩的一个待拟合函数在最后一次拟合中得到的拟合函数作为目标拟合函数。It should be pointed out that the above steps S1031 to S1034 are a process of fitting the functions to be fitted in the function list once. After one fitting (that is, after executing S1034), the function to be fitted in the function list can be detected Whether the number of is 1, if it is not 1, you need to continue to perform subsequent re-fitting, that is, repeat S1031~S1034 until there is only one function to be fitted in the function list; if it is 1, stop subsequent re-fitting and use the fitting function obtained in the last fitting of the only remaining function to be fitted in the function list as the target fitting function.
可选地,可以为函数列表中的每个待拟合函数设置参与拟合标志,且参与拟合标志默认为“true”。在完成一次拟合后,将候选拟合函数对应的待拟合函数的参与拟合标志修改为“false”,表示不参与后续再次拟合;之后,统计函数列表中参与拟合标志为“true”的待拟合函数的个数,如果个数大于1,则利用每个拟合标志为“true”的待拟合函数进行后续再次拟合;如果个数等于1,则将参与拟合标志为“true”的待拟合函数在最后一次拟合中得到的拟合函数作为目标拟合函数。Optionally, the participating fitting flag can be set for each function to be fitted in the function list, and the participating fitting flag is "true" by default. After completing a fitting, change the participating fitting flag of the function to be fitted corresponding to the candidate fitting function to "false", indicating that it will not participate in the subsequent re-fitting; after that, the participating fitting flag in the statistical function list is "true "The number of functions to be fitted, if the number is greater than 1, use each function to be fitted with the fitting flag "true" for subsequent re-fitting; if the number is equal to 1, the fitting flag will be involved The fitting function obtained in the last fitting of the function to be fitted that is "true" is used as the target fitting function.
S1035,函数列表中仅剩一个待拟合函数,将待拟合函数在最后一次拟合中得到的拟合函数作为目标拟合函数。S1035, there is only one function to be fitted left in the function list, and the fitting function obtained in the last fitting of the function to be fitted is used as the target fitting function.
下面对步骤S105进行详细介绍。Step S105 will be described in detail below.
在图2的基础上,请参照图5,步骤S105可以包括S1051~S1054。On the basis of FIG. 2 , please refer to FIG. 5 , step S105 may include S1051-S1054.
S1051,从采样数据集中,获取最后一个采样数据的采样周期。S1051. Obtain a sampling period of the last sampling data from the sampling data set.
从图2可知,针对待监控对象,会按照设定的采样间隔,周期性采样待监控对象的实际数据值。实际数据值的采样过程是持续进行的,并且与函数拟合过程和预警过程互相独立。因此,为了确保预警的准确性,在预警过程中,要基于采样数据集中最后一个采样数据的采样周期进行预警试算。It can be seen from FIG. 2 that for the object to be monitored, the actual data value of the object to be monitored will be periodically sampled according to the set sampling interval. The sampling process of actual data values is continuous and independent from the function fitting process and the early warning process. Therefore, in order to ensure the accuracy of the early warning, during the early warning process, the early warning trial calculation should be carried out based on the sampling period of the last sampled data in the sampled data set.
S1052,根据最后一个采样数据的采样周期、采样间隔以及预先设定的预警时间偏移量,确定未来的一个待预测采样周期。S1052. Determine a sampling period to be predicted in the future according to the sampling period, sampling interval and preset warning time offset of the last sampling data.
在本实施例中,可以按照预设公式:In this embodiment, according to the preset formula:
确定未来的一个待预测采样周期;其中,tΔ表示待预测采样周期,Tp表示预警时间偏移量,Δt表示采样间隔,tmax表示最后一个采样数据的采样周期。Determine a sampling period to be predicted in the future; among them, t Δ represents the sampling period to be predicted, T p represents the early warning time offset, Δt represents the sampling interval, and t max represents the sampling period of the last sampled data.
S1053,将待预测采样周期代入目标拟合函数,得到待监控对象在待预测采样周期的预测值。S1053. Substitute the to-be-predicted sampling period into the target fitting function to obtain the predicted value of the to-be-monitored object in the to-be-predicted sampling period.
在本实施例中,假设目标拟合函数为f(t)=1+2t,则将t=tΔ代入目标拟合函数,求得待监控对象在待预测采样周期的预测值y估。In this embodiment, assuming that the target fitting function is f(t)=1+2t, then t =tΔ is substituted into the target fitting function to obtain the predicted value y estimate of the object to be monitored in the sampling period to be predicted.
S1054,若预测值超出预警阈值,则在预警时刻对待监控对象进行预警;其中,预警时刻在待预测采样周期之前,且预警时刻与所述待预测采样周期相差预警时间偏移量。S1054. If the predicted value exceeds the warning threshold, give a warning to the object to be monitored at the warning time; wherein, the warning time is before the sampling period to be predicted, and the warning time is different from the sampling period to be predicted by the warning time offset.
在本实施例中,得到待监控对象在待预测采样周期的预测值y估之后,将预测值y估与待监控对象的预警阈值进行对比。In this embodiment, after obtaining the predicted value y estimate of the object to be monitored in the predicted sampling period, the predicted value y estimate is compared with the warning threshold of the object to be monitored.
如果预测值未超过预警阈值,则表示待监控对象在待预测采样周期不会发生异常,继续进行下一次预警检测,即,返回执行S1051。If the predicted value does not exceed the warning threshold, it means that the object to be monitored will not be abnormal in the sampling period to be predicted, and the next warning detection is continued, that is, return to S1051.
如果预测值超过预警阈值,则表示待监控对象在待预测采样周期会发生异常,则在预警时刻对待监控对象进行报警。预警时刻在待预测采样周期之前预警时间偏移量处,例如,待预测采样周期为16:00,预警时间偏移量为30min,则预警时刻为15:30。显然,在预警时刻对待监控对象进行报警,可以为系统运维人员预留可控的异常干预时间。If the predicted value exceeds the warning threshold, it means that the object to be monitored will be abnormal in the sampling period to be predicted, and an alarm will be given to the object to be monitored at the time of early warning. The warning time is at the warning time offset before the sampling period to be predicted. For example, if the sampling period to be predicted is 16:00 and the warning time offset is 30 minutes, the warning time is 15:30. Obviously, alarming the monitored objects at the early warning moment can reserve a controllable abnormal intervention time for the system operation and maintenance personnel.
与现有技术相比,本申请实施例具有以下有益效果:Compared with the prior art, the embodiment of the present application has the following beneficial effects:
首先,利用时间函数对待监控对象的未来运行情况进行预估,并且系统运维人员可以自定义扩展时间函数,能够获得更加符合监控需求的时间函数,从而克服了现有技术中设置监控阈值的方式难度大的问题;First, use the time function to predict the future operation of the object to be monitored, and the system operation and maintenance personnel can customize and expand the time function to obtain a time function that is more in line with the monitoring requirements, thus overcoming the way of setting the monitoring threshold in the prior art Difficult problems;
其次,从函数库中选择多个时间函数作为待拟合函数,一个待拟合函数用于表征待监控对象的一种变化趋势,多个待拟合函数可以是系统时间函数、或者扩展时间函数、或者系统时间函数和扩展时间函数兼有,从而可以避免实际中对待监控对象缺乏事先确定对应的拟合函数的问题,实际可操作性高;Secondly, multiple time functions are selected from the function library as the functions to be fitted. One function to be fitted is used to represent a change trend of the object to be monitored. Multiple functions to be fitted can be system time functions or extended time functions. , or both the system time function and the extended time function, so as to avoid the problem of lack of a pre-determined corresponding fitting function for the monitoring object in practice, and the actual operability is high;
第三,采用最小二乘法拟合系统时间函数、以及梯度下降法拟合扩展时间函数的方式,增加了对拟合函数的支持类型,提高了拟合计算的时间效率;Third, the least squares method is used to fit the system time function, and the gradient descent method is used to fit the extended time function, which increases the support type for the fitting function and improves the time efficiency of the fitting calculation;
第四,在函数拟合计算中,采用多拟合计算并行执行的处理方式,大大缩短了多维度函数拟合计算的所需时间,确保预警的及时性;Fourth, in the function fitting calculation, the processing method of parallel execution of multi-fitting calculation is adopted, which greatly shortens the time required for multi-dimensional function fitting calculation and ensures the timeliness of early warning;
第五,引入拟合结果反馈,在多函数拟合时,通过多次拟合计算,淘汰拟合方差和较大的待拟合函数,最终选出所表征的待监控对象的变化趋势与待监控对象的实际变化趋势之间的偏差最小的目标拟合函数,使得利用目标拟合函数进行后续预警时,能够缩小实际数据值和预测数据值的误差范围,提高了预警的准确度;Fifth, introduce the fitting result feedback. In the multi-function fitting, through multiple fitting calculations, the fitting variance and the larger function to be fitted are eliminated, and finally the change trend of the characterized to-be-monitored object and the to-be-fit function are selected. The target fitting function with the smallest deviation between the actual change trends of the monitored objects can reduce the error range between the actual data value and the predicted data value when using the target fitting function for subsequent early warning, and improve the accuracy of the early warning;
第六,在预警阶段,如果预测到待监控对象可能会在未来的某个采样周期发生异常,则提前进行报警,从而可以为系统运维人员预留可控的异常干预时间。Sixth, in the early warning stage, if it is predicted that the object to be monitored may be abnormal in a certain sampling period in the future, an alarm will be issued in advance, so that controllable abnormal intervention time can be reserved for system operation and maintenance personnel.
为了执行上述方法实施例及各个可能的实施方式中的相应步骤,下面给出一种数据预警装置的实现方式。In order to execute the corresponding steps in the foregoing method embodiments and various possible implementation manners, an implementation manner of a data early warning device is given below.
请参照图6,图6示出了本申请实施例提供的数据预警装置100的方框示意图。数据预警装置100应用于电子设备,包括:获取模块101、拟合模块103和预警模块105。Please refer to FIG. 6 , which shows a schematic block diagram of a
获取模块101,用于获取待监控对象对应的函数列表,其中,函数列表包括多个待拟合函数,一个待拟合函数用于表征待监控对象的一种变化趋势。The obtaining
拟合模块103,用于基于待监控对象的实际数据值,对函数列表中的待拟合函数进行多次拟合,得到目标拟合函数;其中,目标拟合函数所表征的待监控对象的变化趋势与待监控对象的实际变化趋势之间的偏差最小。The
预警模块105,用于利用目标拟合函数,对待监控对象进行预警。The
可选地,电子设备存储有函数库,函数库包括多个系统时间函数和多个扩展时间函数,多个扩展时间函数是系统运维人员自定义的;Optionally, the electronic device stores a function library, the function library includes multiple system time functions and multiple extended time functions, and the multiple extended time functions are customized by system operation and maintenance personnel;
获取模块101具体用于:响应选择操作,从函数库中获取多个待拟合函数,得到函数列表;其中,待拟合函数为系统时间函数和扩展时间函数中的至少一种。The
可选地,数据预警装置100还包括采样模块104,采样模块104用于:Optionally, the data
按照预先设定的采样间隔,周期性采样待监控对象的实际数据值;According to the preset sampling interval, the actual data value of the object to be monitored is periodically sampled;
针对每个采样周期,将采样周期及其对应的实际数据值作为一个采样数据,加到预先构建的采样数据集中。For each sampling period, add the sampling period and its corresponding actual data value as a sampling data to the pre-built sampling data set.
可选地,拟合模块103具体用于:Optionally, the
从采样数据集中,获取最后一个采样数据及其之前设定数目个采样数据,得到多个候选采样数据;From the sampling data set, obtain the last sampling data and a set number of sampling data before it, and obtain multiple candidate sampling data;
根据多个候选采样数据,对函数列表中的每个待拟合函数进行拟合,得到每个拟合函数;Fitting each function to be fitted in the function list according to multiple candidate sampling data to obtain each fitting function;
对每个拟合函数进行验证,并确定出候选拟合函数;其中,候选拟合函数所表征的所述待监控对象的变化趋势与待监控对象的实际变化趋势之间的偏差最大;Verifying each fitting function, and determining a candidate fitting function; wherein, the deviation between the change trend of the object to be monitored represented by the candidate fitting function and the actual change trend of the object to be monitored is the largest;
从函数列表中移除候选拟合函数对应的待拟合函数;Remove the function to be fitted corresponding to the candidate fitting function from the function list;
重复执行上述步骤,直至函数列表中仅剩一个待拟合函数,将待拟合函数在最后一次拟合中得到的拟合函数作为目标拟合函数。Repeat the above steps until there is only one function to be fitted left in the function list, and use the fitting function obtained in the last fitting of the function to be fitted as the target fitting function.
可选地,拟合模块103执行根据多个候选采样数据,对函数列表中的每个待拟合函数进行拟合,得到每个拟合函数的方式,可以包括:Optionally, the
针对每个待拟合函数,若待拟合函数为系统时间函数,则根据多个候选采样数据,利用最小二乘法求解待拟合函数中的各个系数,得到拟合函数;For each function to be fitted, if the function to be fitted is a system time function, then according to multiple candidate sampling data, the least square method is used to solve each coefficient in the function to be fitted to obtain the fitted function;
若待拟合函数为扩展时间函数,则根据多个候选采样数据、以及扩展时间函数的系数偏导函数组和系数猜测值,利用梯度下降法求解待拟合函数中的各个系数,得到拟合函数。If the function to be fitted is an extended time function, then use the gradient descent method to solve each coefficient in the function to be fitted according to multiple candidate sampling data, the coefficient partial derivative function group and the coefficient guess value of the extended time function, and obtain the fitting function.
可选地,候选采样数据包括候选采样周期及其对应的实际数据值,拟合模块103执行对每个拟合函数进行验证,并确定出候选拟合函数的方式,可以包括:Optionally, the candidate sampling data includes the candidate sampling period and its corresponding actual data value, and the
针对每个拟合函数,将多个候选采样数据代入拟合函数,得到每个候选采样周期对应的预测数据值;For each fitting function, multiple candidate sampling data are substituted into the fitting function to obtain the predicted data value corresponding to each candidate sampling period;
根据每个候选采样周期对应的预测数据值与实际数据值,计算拟合函数对应的方差和,其中,方差和指示拟合函数所表征的待监控对象的变化趋势与待监控对象的实际变化趋势之间的偏差大小;Calculate the variance sum corresponding to the fitting function according to the predicted data value and the actual data value corresponding to each candidate sampling period, where the variance sum indicates the change trend of the object to be monitored represented by the fitting function and the actual change trend of the object to be monitored The size of the deviation between;
根据每个拟合函数对应的方差和,计算每个拟合函数的拟合结果权值,其中,拟合结果权值表征拟合函数的拟合效果;Calculate the fitting result weight of each fitting function according to the variance sum corresponding to each fitting function, where the fitting result weight represents the fitting effect of the fitting function;
将拟合结果权值最大的拟合函数,作为候选拟合函数。The fitting function with the largest weight of the fitting result is used as a candidate fitting function.
可选地,拟合模块103执行根据每个拟合函数对应的方差和,计算每个拟合函数的拟合结果权值的方式,可以包括:Optionally, the
根据每个拟合函数对应的方差和,利用预设公式According to the variance sum corresponding to each fitting function, use the preset formula
计算每个拟合函数的拟合结果权值;Calculate the fitting result weight of each fitting function;
其中,Wij表示第i个拟合函数的在第j次拟合中的拟合结果权值;Wi(j-1)表示第i个拟合函数在第j-1次拟合中的拟合结果权值,且Wi(j-1)的初始默认值为0;sumij表示第i个拟合函数在第j次拟合中对应的方差和;sumtotal表示参与第j次拟合的每个拟合函数对应的方差和之和,n表示参与第j次拟合的拟合函数的个数,k表示参与第j次拟合的拟合函数的编号。Among them, W ij represents the fitting result weight of the i-th fitting function in the j-th fitting; W i(j-1) represents the weight of the i-th fitting function in the j-1 fitting The weight of the fitting result, and the initial default value of W i(j-1) is 0; sum ij represents the variance sum corresponding to the i-th fitting function in the j-th fitting; sum total represents the participation in the j-th fitting The sum of variances corresponding to each fitting function of the fit, n represents the number of fitting functions participating in the j-th fitting, and k represents the number of the fitting function participating in the j-th fitting.
可选地,预警模块105具体用于:Optionally, the
从采样数据集中,获取最后一个采样数据的采样周期;Obtain the sampling period of the last sampled data from the sampled data set;
根据最后一个采样数据的采样周期、采样间隔以及预先设定的预警时间偏移量,确定未来的一个待预测采样周期;Determine a sampling period to be predicted in the future according to the sampling period, sampling interval and preset warning time offset of the last sampling data;
将待预测采样周期代入目标拟合函数,得到待监控对象在待预测采样周期的预测值;Substitute the sampling period to be predicted into the target fitting function to obtain the predicted value of the object to be monitored in the sampling period to be predicted;
若预测值超出预警阈值,则在预警时刻对待监控对象进行预警;其中,预警时刻在待预测采样周期之前,且预警时刻与所述待预测采样周期相差预警时间偏移量。If the predicted value exceeds the early warning threshold, an early warning is given to the monitored object at the early warning time; wherein, the early warning time is before the sampling period to be predicted, and the warning time is different from the sampling period to be predicted by the warning time offset.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的数据预警装置100的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the
请参照图7,图7示出了本申请实施例提供的电子设备10的方框示意图。电子设备10包括处理器11、存储器12及总线13,处理器11通过总线13与存储器12连接。Please refer to FIG. 7 , which shows a schematic block diagram of an
存储器12用于存储程序,例如图6所示的数据预警装置100,数据预警装置100包括至少一个可以软件或固件(firmware)的形式存储于存储器12中的软件功能模块,处理器11在接收到执行指令后,执行所述程序以实现前述实施例揭示的数据预警方法。The
存储器12可能包括高速随机存取存储器(Random Access Memory,RAM),也可能还包括非易失存储器(non-volatile memory,NVM)。The
处理器11可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器11中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器11可以是通用处理器,包括中央处理器(Central Processing Unit,CPU)、微控制单元(Microcontroller Unit,MCU)、复杂可编程逻辑器件(Complex Programmable LogicDevice,CPLD)、现场可编程门阵列(Field Programmable Gate Array,FPGA)、嵌入式ARM等芯片。The
综上所述,本申请实施例提供的一种数据预警方法、装置、电子设备及存储介质,针对待监控对象,先获取待监控对象对应的函数列表,该函数列表包括多个待拟合函数,一个待拟合函数用于表征待监控对象的一种变化趋势;然后,基于待监控对象的实际数据值,对函数列表中的待拟合函数进行多次拟合,得到所表征的待监控对象的变化趋势与待监控对象的实际变化趋势之间的偏差最小的目标拟合函数;最后,利用目标拟合函数,对待监控对象进行预警;从而能够在故障发生前进行准确预警。To sum up, in the data early warning method, device, electronic equipment and storage medium provided by the embodiments of the present application, for the object to be monitored, first obtain the function list corresponding to the object to be monitored, the function list includes a plurality of functions to be fitted , a function to be fitted is used to represent a change trend of the object to be monitored; then, based on the actual data value of the object to be monitored, the function to be fitted in the function list is fitted multiple times to obtain the characterized The target fitting function with the smallest deviation between the change trend of the object and the actual change trend of the object to be monitored; finally, the target fitting function is used to give an early warning to the monitored object; thus, an accurate early warning can be given before the fault occurs.
以上所述仅为本申请的优选实施例而已,并不用于限制本申请,对于本领域的技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above descriptions are only preferred embodiments of the present application, and are not intended to limit the present application. For those skilled in the art, various modifications and changes may be made to the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of this application shall be included within the protection scope of this application.
Claims (11)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211327899.9A CN115617613A (en) | 2022-10-27 | 2022-10-27 | Data early warning method, device, electronic equipment and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211327899.9A CN115617613A (en) | 2022-10-27 | 2022-10-27 | Data early warning method, device, electronic equipment and storage medium |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN115617613A true CN115617613A (en) | 2023-01-17 |
Family
ID=84876798
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202211327899.9A Pending CN115617613A (en) | 2022-10-27 | 2022-10-27 | Data early warning method, device, electronic equipment and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN115617613A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN117933827A (en) * | 2024-03-13 | 2024-04-26 | 深圳市吉方工控有限公司 | Computer terminal industrial control information data processing method, electronic equipment and storage medium |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110242589A (en) * | 2019-06-25 | 2019-09-17 | 江苏大学 | A Centrifugal Pump Performance Curve Fitting Correction Method |
| CN111881010A (en) * | 2020-07-29 | 2020-11-03 | 北京浪潮数据技术有限公司 | Method and device for predicting performance of storage equipment and computer readable storage medium |
| CN112906955A (en) * | 2021-02-04 | 2021-06-04 | 广东海洋大学 | Tidal data fitting method based on multi-source data driving |
| CN114330531A (en) * | 2021-12-24 | 2022-04-12 | 中电信数智科技有限公司 | Method and device for extracting data features, electronic equipment and storage medium |
| CN115080356A (en) * | 2022-07-21 | 2022-09-20 | 支付宝(杭州)信息技术有限公司 | Abnormity warning method and device |
-
2022
- 2022-10-27 CN CN202211327899.9A patent/CN115617613A/en active Pending
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110242589A (en) * | 2019-06-25 | 2019-09-17 | 江苏大学 | A Centrifugal Pump Performance Curve Fitting Correction Method |
| CN111881010A (en) * | 2020-07-29 | 2020-11-03 | 北京浪潮数据技术有限公司 | Method and device for predicting performance of storage equipment and computer readable storage medium |
| CN112906955A (en) * | 2021-02-04 | 2021-06-04 | 广东海洋大学 | Tidal data fitting method based on multi-source data driving |
| CN114330531A (en) * | 2021-12-24 | 2022-04-12 | 中电信数智科技有限公司 | Method and device for extracting data features, electronic equipment and storage medium |
| CN115080356A (en) * | 2022-07-21 | 2022-09-20 | 支付宝(杭州)信息技术有限公司 | Abnormity warning method and device |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN117933827A (en) * | 2024-03-13 | 2024-04-26 | 深圳市吉方工控有限公司 | Computer terminal industrial control information data processing method, electronic equipment and storage medium |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN108923952B (en) | Fault diagnosis method, equipment and storage medium based on service monitoring index | |
| CN112436968B (en) | Network traffic monitoring method, device, equipment and storage medium | |
| US7975175B2 (en) | Risk indices for enhanced throughput in computing systems | |
| US10558544B2 (en) | Multiple modeling paradigm for predictive analytics | |
| CN114298221B (en) | Fault determination method and device, electronic equipment and computer readable storage medium | |
| WO2020093637A1 (en) | Device state prediction method and system, computer apparatus and storage medium | |
| WO2013042789A1 (en) | Operations management device, operations management method, and program | |
| CN113037595B (en) | Abnormal device detection method and device, electronic device and storage medium | |
| CN109471783B (en) | Method and device for predicting task operation parameters | |
| CN110570544A (en) | Aircraft fuel system fault identification method, device, equipment and storage medium | |
| CN112950908A (en) | Data monitoring and early warning method, system, medium and electronic terminal | |
| CN117093465B (en) | Server log collection method, device, communication equipment and storage medium | |
| CN114365094A (en) | Timing Anomaly Detection Using Inverted Indexing | |
| CN114358581B (en) | Method, device, equipment, and storage medium for determining abnormal thresholds of performance indicators | |
| CN117041029A (en) | Network equipment fault processing method and device, electronic equipment and storage medium | |
| CN111581044A (en) | Cluster optimization method, device, server and medium | |
| US9116804B2 (en) | Transient detection for predictive health management of data processing systems | |
| CN116910507A (en) | Abnormality detection method and device | |
| CN114706893A (en) | Fault detection method, device, equipment and storage medium | |
| CN115617613A (en) | Data early warning method, device, electronic equipment and storage medium | |
| CN113468014A (en) | Abnormity detection method and device for operation and maintenance data | |
| CN119149280A (en) | Log diagnosis method, device, equipment and medium based on flow arrangement | |
| CN117033146B (en) | Identification method, device, equipment and medium for appointed consensus contract execution process | |
| CN109409411B (en) | Problem positioning method and device based on operation and maintenance management and storage medium | |
| CN117573412A (en) | System fault early warning method and device, electronic equipment and storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination |