Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of one or more embodiments of the present description. One or more embodiments of the present specification can be implemented in many different ways than those described herein, and those skilled in the art will appreciate that the embodiments described herein can be similarly generalized without departing from the spirit and scope of the embodiments described herein, and that the embodiments described herein are not limited to the specific implementations disclosed below.
The terminology used in the description of the one or more embodiments is for the purpose of describing the particular embodiments only and is not intended to be limiting of the description of the one or more embodiments. As used in one or more embodiments of the present specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used in one or more embodiments of the present specification refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used in one or more embodiments of the present description to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, a first can also be referred to as a second and, similarly, a second can also be referred to as a first without departing from the scope of one or more embodiments of the present description. The word "if," as used herein, may be interpreted as "at … …" or "at … …" or "in response to a determination," depending on the context.
In the present specification, a prediction method and apparatus, a computing device, and a computer-readable storage medium are provided, which are described in detail one by one in the following embodiments.
First, terms referred to in one or more embodiments of the present specification will be described.
Event change (or change event): the set of operations that cause a change in the state of the online system, such as code release or configuration change, is collectively referred to as an event change.
Key Performance Indicators (Key Performance Indicators, KPI): such as payment success rate, CPU occupancy, memory occupancy, and other key system indicators.
Carrying out transaction: the online system has changed in accordance with the history. Noting the difference between the abnormal movement and the abnormality, the abnormality is certainly a problem (confirmed by manual analysis), and the abnormal movement is only the change which does not accord with the historical rule. An anomaly must be a transaction, and a transaction is not necessarily an anomaly. For example: the new traffic comes online and is a transaction but not an exception.
Prior probability (prior probability): the prior probability refers to the probability obtained from past experience and analysis, such as the total probability formula, which is often used as the probability of occurrence of the "cause" in the "cause-by-cause-effect" problem.
Posterior probability (posteror probability): the posterior probability is a probability of being re-corrected after obtaining information of "result", and is "result" in the "result by cause" problem. The prior probability is inseparably connected with the posterior probability, and the computation of the posterior probability is based on the prior probability.
Fig. 1 is a block diagram illustrating a configuration of a computing device 100 according to an embodiment of the present specification. The components of the computing device 100 include, but are not limited to, memory 110 and processor 120. The processor 120 is coupled to the memory 110 via a bus 130, the database 150 is used for storing data, and the network 160 is used for receiving data stored in the database 150.
Computing device 100 also includes access device 140, access device 140 enabling computing device 100 to communicate via one or more networks 160. Examples of such networks include the Public Switched Telephone Network (PSTN), a Local Area Network (LAN), a Wide Area Network (WAN), a Personal Area Network (PAN), or a combination of communication networks such as the internet. Access device 140 may include one or more of any type of network interface (e.g., a Network Interface Card (NIC)) whether wired or wireless, such as an IEEE802.11 Wireless Local Area Network (WLAN) wireless interface, a worldwide interoperability for microwave access (Wi-MAX) interface, an ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a bluetooth interface, a Near Field Communication (NFC) interface, and so forth.
In one embodiment of the present description, the other components of the computing device 100 described above and not shown in FIG. 1 may also be connected to each other, such as by a bus. It should be understood that the block diagram of the computing device architecture shown in FIG. 1 is for purposes of example only and is not limiting as to the scope of the description. Other components may be added or replaced as desired by those skilled in the art.
Computing device 100 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., tablet computer, personal digital assistant, laptop computer, notebook computer, netbook, etc.), mobile phone (e.g., smartphone), wearable computing device (e.g., smartwatch, smart glasses, etc.), or other type of mobile device, or a stationary computing device such as a desktop computer or PC. Computing device 100 may also be a mobile or stationary server.
Wherein the processor 120 may perform the steps of the method shown in fig. 2. Fig. 2 is a schematic flow diagram illustrating a prediction method according to one or more embodiments of the present specification, including steps 202 to 208:
202. when the fact that the falling amplitude of the system index is larger than or equal to the first threshold value is detected, marking the moment when the falling amplitude of the system index is larger than or equal to the first threshold value as a first moment, and acquiring a first event which is changed in a first time range before the first moment.
The first threshold value may be set according to actual demand, for example, set to 5%. When the drop amplitude of the system index is greater than or equal to 5%, the system is considered to have one abnormal action.
In addition, the first time range may be set as desired, for example, 24 hours. Taking the first time as 35 minutes 00 seconds at 22 o ' clock at 12 o ' clock in 2017, 9 and 12, in this step, the changed event in the time range from 35 minutes 00 seconds at 22 o ' clock at 11 o ' clock in 2017, 9 and 12 o ' clock in 2017 is acquired.
It should be noted that the system index includes multiple indexes such as payment success rate, CPU occupancy, memory occupancy, and the like. In this step, the detection of the fall of the system index is equal to or greater than the first threshold, and does not refer to one of the system indexes, but refers to the detection of any one of the system indexes.
204. And calculating the time attenuation weight coefficient of each changed first event in the first time range.
In this step, the time decay weight coefficient of the first event that has changed in the first time range is calculated by the following formula (1):
N(t)=N 0 e -λt (1)
wherein N is 0 A time decay weight coefficient which is an initial quantity, i.e. the time at which the time is 0;
t is time; λ is a coefficient.
In this step, N 0 Is 1, and lambda is 2, which are empirical values.
206. And calculating to obtain the posterior probability of the system index falling caused by each changed first event according to the time attenuation weight coefficient of each changed first event and the prior probability of the system index falling caused by each changed first event.
Referring to fig. 3, obtaining a prior probability that each changed first event causes a drop in the system index includes:
302. and under the condition that the falling amplitude of the system index is detected to be larger than or equal to the second threshold, marking the moment when the falling amplitude of the system index is larger than or equal to the second threshold as a second moment, and acquiring all the system indexes with the falling amplitudes larger than or equal to the second threshold and the changed first event in a second time range before the second moment.
The second threshold value may be set according to actual demand, for example, set to 4%.
In addition, the first time range may be set as desired, for example, 5 minutes. Taking the first time as 35 min 00 s at 22 o ' clock 12 h/8/2017 as an example, in this step, all the system indicators falling within the time range of 30 min 00 s at 22 o ' clock 12 h/8/2017 to 35 min 00 s at 22 o ' clock 12 h/8/2017 and the first event of change are acquired.
It should be noted that, in the process of acquiring the prior probability, in the case where the drop of one of the system indicators is greater than or equal to the second threshold, not only the first event that is changed in the second time range before the second time is acquired, but all the system indicators whose drops are greater than or equal to the second threshold and the first event that is changed in the second time range need to be acquired.
304. And calculating a correlation coefficient between each system index with the drop amplitude larger than or equal to a second threshold value and each changed first event.
In step 304, calculating a correlation coefficient between each of the system indicators having the fall amplitude greater than or equal to the second threshold and each of the first events having the change, specifically includes: and calculating a correlation coefficient between the system index with the falling amplitude larger than or equal to the second threshold value and each changed first event according to the number of association times between each system index with the falling amplitude larger than or equal to the second threshold value and each changed first event in the second time range.
The algorithm of the correlation coefficient includes a plurality of algorithms, and the embodiment calculates the correlation coefficient by using the Pearson's Chi-Square test.
Specifically, a correlation coefficient between one of the system indicators, the fall of which is equal to or greater than the second threshold value, and one of the changed first events is calculated by the following formula (2):
X 2 =[N(O 11 O 22 -O 12 O 21 ) 2 ]/[(O 11 +O 12 )(O 11 +O 21 )(O 12 +O 22 )(O 21 +O 22 )] (2)
wherein the content of the first and second substances,
n represents the sum of the correlation times of all changed first events in a second time range and all system indexes with the falling amplitude larger than or equal to a second threshold value;
O 11 a number of associations representing the one of the changed first events within the second time frame with the one of the system indicators having a drop in magnitude equal to or greater than a second threshold;
O 12 indicating other changes in said second time rangeThe number of times of association of the first event with the one of the system indicators having a drop amplitude greater than or equal to a second threshold value;
O 21 the number of times of correlation of the first event representing the change of the one of the first time ranges with other system indexes with the falling amplitude larger than or equal to a second threshold value;
O 22 a number of associations between the first event representing the other changes in the second time frame and the other system indicators having a drop amplitude greater than or equal to a second threshold.
Through the formula (1), a correlation coefficient between any one of the system indicators having a drop amplitude equal to or greater than the second threshold value and any one of the first events having a change can be determined.
306. And determining the prior probability of the system index falling caused by each changed first event according to the correlation coefficient.
In this step, determining the prior probability according to the correlation coefficient may be obtained by table lookup. For example, if the pearson correlation coefficient between a system index and a first event that has changed is 3.841, and the confidence level corresponding to 3.841 obtained from table lookup is 0.05, the prior probability that the first event that has changed causes the system index to drop is 5%.
208. And determining a second event of the first events, wherein the posterior probability is greater than or equal to a probability threshold value, and taking the second event as a main event causing the system index to drop.
The probability threshold may be set according to requirements, for example, the probability threshold is set to be 10%.
The posterior probability that the changed first event causes the system index to drop is calculated by the following formula (3):
P=N(t)*Q (3)
wherein N (t) is a time decay weight coefficient of the changed first event;
p is the posterior probability that the first event of the change causes the system index to drop;
q is the prior probability that the first event that changed causes the system index to drop.
In addition, after the second event that the posterior probability is greater than or equal to the probability threshold is determined, the second event can be output according to the sequence of the posterior probabilities from large to small so as to be convenient for the user to view and perform subsequent processing.
According to the prediction method provided by the specification, the time attenuation weight coefficient of each changed first event in a first time range is calculated, and a second event of which the posterior probability causing the system index to fall is larger than a probability threshold value is calculated and obtained according to the time attenuation weight coefficient of each first event and the prior probability of each first event causing the system index to fall, so that the analysis range required by emergency personnel for positioning problems is reduced, and the emergency efficiency is improved.
For ease of understanding, a specific example is described below. Referring to fig. 4, a prediction method in one or more embodiments of the present description includes:
402. under the condition that the falling amplitude of the system index is detected to be larger than or equal to the second threshold, marking the moment when the falling amplitude of the system index is larger than or equal to the second threshold as a second moment, and acquiring all the system indexes with the falling amplitudes larger than or equal to the second threshold and the changed first events in a second time range t2 before the second moment.
In this example, the first events that are changed within the second time range t2 include a first event a and a first event B.
In this example, the system indicator having a drop amplitude greater than or equal to the second threshold value includes KPI 1 ~KPI 3 。
404. Calculating system index KPI of each drop amplitude greater than or equal to second threshold 1 ~KPI 3 A correlation coefficient with each of said modified first events a-B.
Specifically, a correlation coefficient between the system index and the first event of the change can be calculated by the above formula (2).
406. Determining that the first event A-B with each change causes the system indicator KPI according to the correlation coefficient 1 ~KPI 3 The prior probability of a drop.
The first event A causes a system indicator KPI 1 The prior probability of a drop is 80%, the first event B causes the system indicator KPI 1 The prior probability of a drop is 20%;
the first event A causes a system indicator KPI 2 The prior probability of a drop is 30%, the first event B causes the system indicator KPI 2 The prior probability of a drop is 70%;
the first event A causes the System indicator KPI 3 The prior probability of a drop is 50%, the first event B causes the system indicator KPI 3 The a priori probability of falling is 50%.
The above steps 402 to 406 are steps of prior probability that each of the changed first events causes a drop in the system index. After obtaining the prior probability, the prior probability may be pre-stored in the storage space of the local system and called when calculating the posterior probability in the following steps.
408. When a system index KPI is detected 1 When the drop amplitude of the system index is greater than or equal to the first threshold value, marking the moment when the drop amplitude of the system index is greater than or equal to the first threshold value as a first moment, and acquiring a first event A which is changed in a first time range before the first moment.
410. Calculating to obtain a first event A to cause the system index KPI 1 Posterior probability of drop.
Specifically, a time attenuation weight coefficient of the first event a in the first time range is calculated by the above formula (1), and then the system indicator KPI is caused according to the time attenuation weight coefficient of the first event a and the first event a 1 The prior probability of falling is calculated by the formula (3) to obtain a first event A which causes the system indicator KPI 1 Posterior probability of a drop.
In this example, obtaining a first event A causes the system indicator KPI 1 The posterior probability of a drop is 100%. The first event a is taken as the second event causing the system index to drop.
Through the prediction method of one or more embodiments of the specification, when a problem occurs, the system index drop caused by the change of any kind of event can be predicted, so that the analysis range required by emergency personnel for positioning the problem is reduced, and the emergency efficiency is improved.
One or more embodiments of the present specification also disclose a prediction apparatus, referring to fig. 5, the apparatus including:
a first obtaining module 502, configured to mark, as a first time, a time when a drop of a system indicator is detected to be greater than or equal to a first threshold, and obtain a first event that is changed within a first time range before the first time;
a weight coefficient calculation module 504, configured to calculate a time decay weight coefficient of each changed first event in the first time range;
a posterior probability obtaining module 506, configured to calculate, according to the time decay weight coefficient of each changed first event and the prior probability that each changed first event causes the system index to drop, a posterior probability that each changed first event causes the system index to drop;
and a determining module 508, configured to determine a second event, of the first events, where the posterior probability is greater than or equal to a probability threshold, and use the second event as a main event causing the system index to drop.
Optionally, the prediction apparatus disclosed in one or more embodiments of the present specification further includes:
a second obtaining module 510, configured to mark, when it is detected that the drop amplitude of the system indicator is greater than or equal to a second threshold, a time at which the drop amplitude of the system indicator is greater than or equal to the second threshold as a second time, and obtain all system indicators whose drop amplitudes are greater than or equal to the second threshold and a first event that occurs a change within a second time range before the second time;
a correlation coefficient calculation module 512, configured to calculate a correlation coefficient between each of the system indicators with the drop amplitude being greater than or equal to a second threshold and each of the first changed events;
a prior probability obtaining module 514, configured to determine, according to the correlation coefficient, a prior probability that each changed first event causes the system index to drop.
Optionally, the correlation coefficient calculating module 512 calculates a correlation coefficient between each of the system indicators with the fall amplitude being greater than or equal to the second threshold and each of the changed first events according to the number of times of association between each of the system indicators with the fall amplitude being greater than or equal to the second threshold and each of the changed first events in the second time range.
Specifically, the correlation coefficient calculation module 512 calculates a correlation coefficient between one of the system indicators having a drop amplitude greater than or equal to the second threshold and one of the first events having a change, and calculates the correlation coefficient according to the above formula (2).
Optionally, the weight coefficient calculating module 504 calculates a time decay weight coefficient of the changed first event in the first time range, and calculates the time decay weight coefficient according to the above formula (1).
Optionally, the posterior probability obtaining module 506 obtains the posterior probability that the first event that changes causes the system index to drop, and calculates the posterior probability according to the above formula (3).
According to the prediction device provided by the specification, the time attenuation weight coefficient of each changed first event in a first time range is calculated, and the first event of which the posterior probability causing the system index to fall is greater than the probability threshold value is calculated and obtained according to the time attenuation weight coefficient of each first event and the prior probability of each first event causing the system index to fall, so that the analysis range required by emergency personnel for positioning problems is reduced, and the emergency efficiency is improved.
An embodiment of the present specification further provides a computer readable storage medium storing computer instructions which, when executed by a processor, implement the steps of the prediction method as described above.
The above is an illustrative scheme of a computer-readable storage medium of the present embodiment. It should be noted that the technical solution of the storage medium belongs to the same concept as the technical solution of the prediction method, and for details that are not described in detail in the technical solution of the storage medium, reference may be made to the description of the technical solution of the prediction method.
The computer instructions comprise computer program code which may be in the form of source code, object code, an executable file or some intermediate form, or the like. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, read-Only Memory (ROM), random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer-readable medium may contain suitable additions or subtractions depending on the requirements of legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer-readable media may not include electrical carrier signals or telecommunication signals in accordance with legislation and patent practice.
It should be noted that, for the sake of simplicity, the above-mentioned method embodiments are described as a series of acts or combinations, but those skilled in the art should understand that the present application is not limited by the described order of acts, as some steps may be performed in other orders or simultaneously according to the present application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to the related descriptions of other embodiments.
The preferred embodiments of the present application disclosed above are intended only to aid in the explanation of the application. Alternative embodiments are not exhaustive and do not limit the invention to the precise embodiments described. Obviously, many modifications and variations are possible in light of the above teaching. The embodiments were chosen and described in order to best explain the principles of the application and the practical application, to thereby enable others skilled in the art to best understand and utilize the application. The application is limited only by the claims and their full scope and equivalents.