Disclosure of Invention
The invention mainly aims to solve the technical problems that the existing service data monitoring method is not suitable for data monitoring of special festivals and cannot meet the requirements of users.
A first aspect of the present invention provides a method for monitoring service data, where the method for monitoring service data includes:
obtaining the actual service data value N of the current momentc;
Judging whether the current time belongs to a holiday or not;
if the current time belongs to the holidays, the service data values N of the same holidays in the previous N years at the same time are sequentially acquired1,N2,...,Nn;
Calculating a first estimated value Ne,Ne=k1*N1+k2*N2+...+kn*NnWherein k is1,k2,...,knIs a first weighting coefficient;
calculating a first estimated value NeAnd the actual service data value NcAnd comparing the absolute value of the difference with a preset first threshold value delta;
if | Ne-Nc|<Delta, then judging the actual service data value N at the current momentcNormal;
if | Ne-Nc|>Delta, then judging the actual service data value N at the current momentcAnd (6) abnormal.
In an optional implementation manner of the first aspect of the present invention, the method for monitoring service data further includes:
if the current time does not belong to the holidays, the service data values N of the same time on the same day of the previous N weeks are sequentially acquired1’,N2’,...,Nn’;
Calculating a second estimate Ne’,Ne’=k1’*N1’+k2’*N2’+...+kn’*Nn', wherein k1’,k2’,...,kn' is a second weighting factor;
calculating a second estimate Ne' and actual traffic data value Nc'and comparing with a preset second threshold value delta';
if | Ne’-Nc’|<Delta', judging the actual service data value N at the current momentcNormal;
if | Ne’-Nc’|>Delta', judging the actual service data value N at the current momentcAnd (6) abnormal.
In an alternative embodiment of the first aspect of the present invention, k is1Not less than k2K is not less thannSaid k is1' > not less than k2' > or ≥ Nn’。
In an optional implementation manner of the first aspect of the present invention, the method for monitoring service data further includes:
for actual service data NcNormal times and actual service data NcThe number of anomalies is counted.
In an optional implementation manner of the first aspect of the present invention, when it is necessary to determine whether a service is abnormal within a period of time, actual service data N within a period of time is obtainedcNumber of normalizations a1And actual service data NcNumber of anomalies b1;
Loading corresponding evaluation strategies according to the current scene and based on the times a1And said number of times b1And judging whether the service is abnormal or not.
In an optional implementation manner of the first aspect of the present invention, the loading of the adapted evaluation policy according to the current scenario is based on the number a1And said number of times b1Judging whether the service is abnormal comprises the following steps:
in one scenario, the number of times b is set1Compared with a fixed value K, if b1>K, judging that the service is abnormal and generating alarm information;
in another scenario, the number of times b is set1And the number of times a1Making a comparison if b1>a1If so, judging that the service is abnormal and generating alarm information.
In an optional implementation manner of the first aspect of the present invention, the obtaining of the actual service data value N at the current time is performedcIn minutes.
A second aspect of the present invention provides a service data monitoring apparatus, where the service data monitoring apparatus includes:
a first obtaining module, configured to obtain an actual service data value N at a current timec;
The first judgment module is used for judging whether the current moment belongs to a holiday or not;
a second obtaining module for determining if the current time belongs to the holidaySequentially acquiring the service data values N of the same holidays and the same festivals in the previous N years1,N2,...,Nn;
A first calculation module for calculating a first estimated value Ne,Ne=k1*N1+k2*N2+...+kn*NnWherein k is1,k2,...,knIs a first weighting coefficient;
a second calculation module for calculating a first estimated value NeAnd the actual service data value NcAnd comparing the absolute value of the difference with a preset first threshold value delta;
a second judgment module for judging if | Ne-Nc|<Delta, then judging the actual service data value N at the current momentcNormal;
a third judging module for judging if | Ne-Nc|>Delta, then judging the actual service data value N at the current momentcAnd (6) abnormal.
A third aspect of the present invention provides a service data monitoring device, where the service data monitoring device includes: a memory having instructions stored therein and at least one processor, the memory and the at least one processor interconnected by a line;
the at least one processor calls the instructions in the memory to cause the monitoring device of the business data to execute the monitoring method of the business data according to any one of the above.
A fourth aspect of the present invention provides a computer-readable storage medium, having stored thereon a computer program, which, when executed by a processor, implements the method for monitoring traffic data according to any one of the above.
Has the advantages that: the invention provides a method, a device, equipment and a storage medium for monitoring service data, wherein the monitoring method comprises the following steps: obtaining the actual service data value N of the current momentc(ii) a Judging whether the current time belongs to a holiday or not; if the current time belongs to the holidays, the same holidays in the previous N years are sequentially acquiredService data value N at the same time1,N2,...,Nn(ii) a Calculating a first estimated value Ne,Ne=k1*N1+k2*N2+...+kn*NnWherein k is1,k2,...,knIs a first weighting coefficient; calculating a first estimated value NeAnd the actual service data value NcAnd comparing the absolute value of the difference with a preset first threshold value delta; if | Ne-Nc|<Delta, then judging the actual service data value N at the current momentcNormal; if | Ne-Nc|>Delta, then judging the actual service data value N at the current momentcAnd (6) abnormal. The monitoring method of the invention improves the adaptability of the business data monitoring of the holidays and the festivals, and improves the monitoring quality of the business data.
Detailed Description
The embodiment of the invention provides a method, a device, equipment and a storage medium for monitoring service data.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be practiced otherwise than as specifically illustrated or described herein. Furthermore, the terms "comprises," "comprising," or "having," and any variations thereof, are intended to cover non-exclusive inclusions, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
For convenience of understanding, a specific flow of an embodiment of the present invention is described below, and referring to fig. 1, a first aspect of the present invention provides a method for monitoring service data, where the method for monitoring service data includes:
s100, acquiring the actual service data value N of the current momentc;
In this embodiment, the actual service data value N at the current time is obtainedcThe actual service data value N at the current time can be collected every minute, in units of seconds, minutes or hours, for example, minutesc;
S200, judging whether the current time belongs to a holiday or not;
in this embodiment, since the business data of the holiday may have sudden changes, a specific monitoring strategy needs to be adopted for the holiday;
s300, if the current time belongs to a holiday, sequentially acquiring the service data values N of the same holiday and the same time in the previous N years1,N2,...,Nn;
In the embodiment, the data of the holidays are compared with the data of the same holidays in the previous N years, so that the change of the business data can be more clearly known, and the business data of the holidays can be more accurately monitored;
s400, calculating a first estimated value Ne,Ne=k1*N1+k2*N2+...+kn*NnWherein k is1,k2,...,knIs a first weighting coefficient;
in this embodiment, the present invention obtains the predicted value of the service data by using a weighted calculation method, so that the change of the service data can be reflected more clearly;
500. calculating a first estimated value NeAnd the actual service data value NcOf (d) and (d) are compared with each otherComparing the set first threshold value delta;
in the present embodiment, the actual service data value N is determinedcWhether the wave fluctuates within a preset range or not is judged to be normal or not;
s600, if | Ne-Nc|<Delta, then judging the actual service data value N at the current momentcNormal;
s700, if | Ne-Nc|>Delta, then judging the actual service data value N at the current momentcAnd (6) abnormal.
The invention provides a business data monitoring scheme which has the characteristics of self-adaption and self-learning and can effectively provide monitoring quality. The overall characteristics are as follows: the self-adaptive service development automatically estimates the service data value at the current time, and various prediction algorithms meet the monitoring schemes under different scenes, so that the service monitoring quality during special festivals and operation activities is improved.
Referring to fig. 2, in an optional implementation manner of the first aspect of the present invention, the method for monitoring service data further includes:
s300', if the current time does not belong to the holidays, the service data values N of the same time on the same day of the previous N weeks are sequentially acquired1’,N2’,...,Nn’;
S400', calculating a second estimated value Ne’,Ne’=k1’*N1’+k2’*N2’+...+kn’*Nn', wherein k1’,k2’,...,kn' is a second weighting factor;
s500', calculating a second estimated value Ne' and actual traffic data value Nc'and comparing with a preset second threshold value delta';
s600' if | Ne’-Nc’|<Delta', judging the actual service data value N at the current momentcNormal;
s700', if | Ne’-Nc’|>Delta', judging the actual service data value N at the current momentcAnd (6) abnormal.
In an alternative embodiment of the first aspect of the present invention, k is1Not less than k2K is not less thannSaid k is1' > not less than k2' > or ≥ Nn'. In this embodiment, the longer the data is, the smaller the weight will be, i.e. the smaller the influence on the actual service data is, and k is for different scenes1,k2,...knAnd k1’,k2’,...,kn' may be generated by different schemes, of course, k1,k2,...knAnd k1’,k2’,...,kn'may be the same, and the first threshold value δ and the second threshold value δ' may be the same.
In an optional implementation manner of the first aspect of the present invention, the method for monitoring service data further includes:
for actual service data NcNormal times and actual service data NcThe number of anomalies is counted.
In this embodiment, the present invention will apply to actual traffic data N per second, minute or hourcCounting the number of normality and abnormality, e.g. if | Ne-Nc|<Delta or | Ne’-Nc’|<δ', then the actual service data value at the current moment is considered to be normal, and the normal count is + 1; if | Ne-Nc|>Delta or | Ne’-Nc’|>δ', then it is assumed that there may be an anomaly in the value of the current time, anomaly count + 1.
In an optional implementation manner of the first aspect of the present invention, when it is necessary to determine whether a service is abnormal within a period of time, actual service data N within a period of time is obtainedcNumber of normalizations a1And actual service data NcNumber of anomalies b1;
Loading corresponding evaluation strategies according to the current scene and based on the times a1And said number of times b1And judging whether the service is abnormal or not.
In the first aspect of the present inventionIn an optional embodiment, the adaptive evaluation policy is loaded according to the current scenario, and the number a is based on1And said number of times b1Judging whether the service is abnormal comprises the following steps:
in one scenario, the number of times b is set1Compared with a fixed value K, if b1>K, judging that the service is abnormal and generating alarm information;
in another scenario, the number of times b is set1And the number of times a1Making a comparison if b1>a1If so, judging that the service is abnormal and generating alarm information.
In this embodiment, there are two evaluation strategies in the technical solution of the present invention, which are respectively:
(1) fixed value policy, i.e. when b1>And K, alarming. The method comprises the following steps that if abnormality occurs more than K times in a certain time window, the service in the time window is considered to be abnormal;
(2) relative value strategy, i.e. when b1>a1And (5) alarming. Meaning that within a certain time window, the number of times of evaluating the anomaly is greater than the number of times of normal, then the service in the time window is considered to be abnormal.
In an optional implementation manner of the first aspect of the present invention, the obtaining of the actual service data value N at the current time is performedcIn minutes.
Referring to fig. 3, a second aspect of the present invention provides a service data monitoring apparatus, including:
a first obtainingmodule 10, configured to obtain an actual service data value N at a current timec;
The first judgingmodule 20 is configured to judge whether the current time belongs to a holiday or not;
a second obtainingmodule 30, configured to, if the current time belongs to a holiday, sequentially obtain service data values N of the same holiday and the same time in the previous N years1,N2,...,Nn;
Afirst calculation module 40 for calculating a first estimated value Ne,Ne=k1*N1+k2*N2+...+kn*NnWherein k is1,k2,...,knIs a first weighting coefficient;
asecond calculation module 50 for calculating the first estimated value NeAnd the actual service data value NcAnd comparing the absolute value of the difference with a preset first threshold value delta;
asecond decision module 60 for deciding if Ne-Nc|<Delta, then judging the actual service data value N at the current momentcNormal;
a third determiningmodule 70 for determining if | Ne-Nc|>Delta, then judging the actual service data value N at the current momentcAnd (6) abnormal.
In an optional implementation manner of the second aspect of the present invention, the second obtaining module is further configured to, if the current time does not belong to a holiday, sequentially obtain the service data values N at the same time on the same day of the previous N weeks1’,N2’,...,Nn’;
The first calculation module is further used for calculating a second estimated value Ne’,
Ne’=k1’*N1’+k2’*N2’+...+kn’*Nn', wherein k1’,k2’,...,kn' is a second weighting factor;
the second calculation module is further used for calculating a second estimated value Ne' and actual traffic data value Nc'and comparing with a preset second threshold value delta';
the second judgment module is also used for judging if | Ne’-Nc’|<Delta', judging the actual service data value N at the current momentcNormal;
the third judging module is also used for judging if | Ne’-Nc’|>Delta', judging the actual service data value N at the current momentcAnd (6) abnormal.
In the second aspect of the invention, an alternativeIn an embodiment, k is1Not less than k2K is not less thannSaid k is1' > not less than k2' > or ≥ Nn’。
In an optional implementation manner of the second aspect of the present invention, the monitoring apparatus for service data further includes:
a statistic module for calculating actual service data NcNormal times and actual service data NcThe number of anomalies is counted.
In an optional implementation manner of the second aspect of the present invention, when it is necessary to determine whether a service is abnormal within a period of time, actual service data N within a period of time is obtainedcNumber of normalizations a1And actual service data NcNumber of anomalies b1;
Loading corresponding evaluation strategies according to the current scene and based on the times a1And said number of times b1And judging whether the service is abnormal or not.
In an optional implementation manner of the second aspect of the present invention, the loading of the adapted evaluation policy according to the current scenario is based on the number a1And said number of times b1Judging whether the service is abnormal comprises the following steps:
in one scenario, the number of times b is set1Compared with a fixed value K, if b1>K, judging that the service is abnormal and generating alarm information;
in another scenario, the number of times b is set1And the number of times a1Making a comparison if b1>a1If so, judging that the service is abnormal and generating alarm information.
In an optional implementation manner of the second aspect of the present invention, the obtaining of the actual service data value N at the current time is performedcIn minutes.
Fig. 4 is a schematic structural diagram of a monitoring device for service data according to an embodiment of the present invention, where the monitoring device for service data may generate a relatively large difference due to different configurations or performances, and may include one or more processors 80 (CPUs) (e.g., one or more processors) and amemory 90, and one or more storage media 100 (e.g., one or more mass storage devices) for storing applications or data. The memory and storage medium may be, among other things, transient or persistent storage. The program stored on the storage medium may include one or more modules (not shown), each of which may include a series of instruction operations in a monitoring device for traffic data. Further, the processor may be configured to communicate with the storage medium and execute a series of instruction operations in the storage medium on the monitoring device for the business data.
The monitoring device for traffic data may also include one ormore power supplies 110, one or more wired or wireless network interfaces 120, one or more input-output interfaces 130, and/or one or more operating systems, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. Those skilled in the art will appreciate that the configuration of the traffic data monitoring device shown in fig. 4 does not constitute a limitation of the traffic data monitoring device and may include more or fewer components than shown, or some components may be combined, or a different arrangement of components.
The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium, or a volatile computer-readable storage medium, having stored therein instructions, which, when executed on a computer, cause the computer to perform the steps of the method for monitoring business data.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses, and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.