CN104778185B - Anomaly sxtructure query language SQL statement determines method and server - Google Patents

Anomaly sxtructure query language SQL statement determines method and server Download PDF

Info

Publication number
CN104778185B
CN104778185B CN201410018621.2A CN201410018621A CN104778185B CN 104778185 B CN104778185 B CN 104778185B CN 201410018621 A CN201410018621 A CN 201410018621A CN 104778185 B CN104778185 B CN 104778185B
Authority
CN
China
Prior art keywords
sql statement
collection period
business sql
business
average performance
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.)
Active
Application number
CN201410018621.2A
Other languages
Chinese (zh)
Other versions
CN104778185A (en
Inventor
王江
康姝婷
马洪利
陈海涛
杨晶
孙晓
王辉
王岩
丁健
杨海威
姜宏岩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Group Beijing Co Ltd
Original Assignee
China Mobile Group Beijing Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by China Mobile Group Beijing Co Ltd filed Critical China Mobile Group Beijing Co Ltd
Priority to CN201410018621.2A priority Critical patent/CN104778185B/en
Publication of CN104778185A publication Critical patent/CN104778185A/en
Application granted granted Critical
Publication of CN104778185B publication Critical patent/CN104778185B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a kind of anomaly sxtructure query language SQL statement to determine method and server, and this method includes:Total execution time of each first business SQL statement in current collection period and total execution number are obtained, using the first business SQL statement corresponding to total execution time before the first setting number as the second business SQL statement;Obtain total execution time and total execution number of each second business SQL statement in selected collection period;Calculate the rate of rise of the average performance times of corresponding second business SQL statement;Judge whether the rate of rise of the average performance times of each second business SQL statement is more than the first given threshold respectively, judge average performance times rate of rise be more than the first given threshold the second business SQL statement be abnormal SQL statement.The program ensures that system operation is normal and Consumer's Experience is good.

Description

Anomaly sxtructure query language SQL statement determines method and server
Technical field
The present invention relates to communication technical field, espespecially a kind of anomaly sxtructure query language(Structured Query Language, SQL)Sentence determines method and server.
Background technology
SQL statement is the syntax that a kind of data in database are defined and operated, abnormal SQL statement(Can also Referred to as slow query SQL sentence or big SQL statement)Refer to perform speed compared with slowly and to the larger business of database performance impact SQL statement.When user inquires about etc. operation using client executing credit balance inquiry, set meal usage amount, client can be to Server sends inquiry request, and server is looked into according to the inquiry request received using business SQL statement in database Ask, if there is abnormal SQL statement, then can take the substantial amounts of system resource of server, inquiry velocity is also very slow, in client It is slower to will appear as performing the speed of related service operation, influences Consumer's Experience.
At present, it is determined that the method for abnormal SQL statement is, when the substantial amounts of system resource of server is consumed and Consumer's Experience When bad, abnormal SQL statement can be just found by analysis, conventional analysis method includes following two:
The first, the related service for influenceing Consumer's Experience, passes through the feature of related service(Source address, client name Title, related service table etc.)Database session is tracked to obtain tracking file, then analysis tracking file determines related industry Business SQL statement, further analyze executive plan, execution time of these related business SQL statements etc. and determine abnormal SQL languages Sentence.
Second, the business SQL statement to consuming substantial amounts of system resource, according to execution time, consumed resource etc. The business SQL for finding and coming above is ranked up, the access path of these business SQL statements is then analyzed, judges these business SQL specific business, finally determines abnormal SQL statement.
The method of above-mentioned determination exception SQL statement can only influence systematic function and Consumer's Experience in abnormal SQL statement When, being analyzed by professional can just determine, can not abnormal SQL statement just occur also without influence systematic function and Analysis is predicted during Consumer's Experience.Therefore a kind of method that can determine abnormal SQL statement in advance is needed, it is different so as to prevent Normal SQL statement consumes substantial amounts of system resource and influences Consumer's Experience.
The content of the invention
The embodiment of the present invention provides a kind of abnormal SQL statement and determines method and server, to determine abnormal SQL languages in advance Sentence, substantial amounts of system resource and influence Consumer's Experience are consumed so as to prevent abnormal SQL statement.
Therefore, the embodiment of the present invention provides a kind of abnormal SQL statement and determines method, including:
Total execution time of each first business SQL statement in current collection period and total execution number are obtained, will be obtained The total execution time taken sorts according to order from big to small, the corresponding to total execution time before the first setting number One business SQL statement is as the second business SQL statement;
Obtain the selected of second setting number of each second business SQL statement before the current collection period Total execution time and total execution number in collection period;
According to each second business SQL statement in the current collection period and each selected collection period Interior total execution time and total rate of rise for performing number, calculating the average performance times of corresponding second business SQL statement;
Judge whether the rate of rise of the average performance times of each second business SQL statement sets more than first respectively Determine threshold value, judge average performance times rate of rise be more than first given threshold the second business SQL statement be exception SQL statement.
Specifically, obtain total execution time and total execution time of each first business SQL statement in current collection period Number, is specifically included:
The execution time of each first business SQL statement of continuous collecting and execution number;
By the execution time of each first business SQL statement gathered after the current collection period expires, subtract Go in the execution of correspondence the first business SQL statement gathered after the previous collection period of the current collection period expires Between, obtain total execution time of the corresponding first business SQL statement in the current collection period;And
By the execution number of each first business SQL statement gathered after the current collection period expires, subtract The execution time of correspondence the first business SQL statement gathered is gone after the previous collection period of the current collection period expires Number, obtain total execution number of the corresponding first business SQL statement in the current collection period.
Specifically, according to each second business SQL statement in the current collection period and each described selected Total execution time and total increasing for performing number, calculating the average performance times of corresponding second business SQL statement in collection period Long speed, is specifically included:
According to each second business SQL statement in the current collection period and each selected collection period Interior total execution time and always execution number, the corresponding second business SQL statement of calculating is in the currently collection period and each Average performance times in the selected collection period;
According to each second business SQL statement in the current collection period and each selected collection period Interior average performance times, calculate the rate of rise of the average performance times of corresponding second business SQL statement.
Specifically, according to each second business SQL statement in the current collection period and each described selected Average performance times in collection period, the rate of rise of the average performance times of corresponding second business SQL statement is calculated, specifically Including:
For each second business SQL statement, perform:
The current collection period and each selected collection period are numbered according to time order and function order, established Number two tuples with corresponding average performance times;
Current being averaged for second business SQL statement is fitted according to two tuples of foundation using simple regression analysis method to hold Unitary linear formula y=a+bts of the row time y on numbering t;
Rate of rise using b as the average performance times of the current second business SQL statement.
Optionally, in addition to:
Using the rate of rise of average performance times be less than or equal to first given threshold the second business SQL statement as 3rd business SQL statement;
Predict corresponding 3rd business SQL statement respectively according to the unitary linear formula of each 3rd business SQL statement Average performance times in next collection period of the current collection period;
According to each 3rd business SQL statement of acquisition in next collection period of the current collection period Total execution time and total actual average performance times for performing number, calculating corresponding 3rd business SQL statement;
Calculate reality of each 3rd business SQL statement in next collection period of the current collection period Average performance times with prediction average performance times ratio, ratio be more than the second given threshold the 3rd business SQL be Abnormal SQL statement.
Specifically, fit current second business SQL statement using simple regression analysis method according to two tuples of foundation Unitary linear formula y=a+bts of the average performance times y on numbering t, specifically include:
B and a are obtained by following equation:
Wherein,Adopted for the current second business SQL statement in the current collection period and each described select Collect the average value of the average performance times in the cycle,For the average value of the numbering of the current second business SQL statement,For The numbering of the current second business SQL statement square average value.
A kind of server is also provided, including:
First acquisition unit, for obtaining total execution time of each first business SQL statement in current collection period Number is performed with total, total execution time of acquisition is sorted according to order from big to small, before the first setting number It is total to perform the first business SQL statement corresponding to the time as the second business SQL statement;
Second acquisition unit, for obtaining each second business SQL statement before the current collection period Total execution time and total execution number in the selected collection period of second setting number;
Computing unit, for each second business SQL statement of basis in the current collection period and each institute Total execution time in selected collection period and total execution number are stated, when calculating the average execution of corresponding second business SQL statement Between rate of rise;
Identifying unit, the rate of rise of the average performance times for judging each second business SQL statement respectively Whether it is more than the first given threshold, judges that the rate of rise of average performance times is more than the second business of first given threshold SQL statement is abnormal SQL statement.
Specifically, the first acquisition unit, for obtaining each first business SQL statement in current collection period It is total to perform time and total execution number, it is specifically used for:
The execution time of each first business SQL statement of continuous collecting and execution number;
By the execution time of each first business SQL statement gathered after the current collection period expires, subtract Go in the execution of correspondence the first business SQL statement gathered after the previous collection period of the current collection period expires Between, obtain total execution time of the corresponding first business SQL statement in the current collection period;And
By the execution number of each first business SQL statement gathered after the current collection period expires, subtract The execution time of correspondence the first business SQL statement gathered is gone after the previous collection period of the current collection period expires Number, obtain total execution number of the corresponding first business SQL statement in the current collection period.
Specifically, the computing unit, is specifically used for:
According to each second business SQL statement in the current collection period and each selected collection period Interior total execution time and always execution number, the corresponding second business SQL statement of calculating is in the currently collection period and each Average performance times in the selected collection period;
According to each second business SQL statement in the current collection period and each selected collection period Interior average performance times, calculate the rate of rise of the average performance times of corresponding second business SQL statement.
Specifically, the computing unit, for each second business SQL statement of basis in the current collection period And the average performance times in each selected collection period, when calculating the average execution of corresponding second business SQL statement Between rate of rise, be specifically used for:
For each second business SQL statement, perform:
The current collection period and each selected collection period are numbered according to time order and function order, established Number two tuples with corresponding average performance times;
Current being averaged for second business SQL statement is fitted according to two tuples of foundation using simple regression analysis method to hold Unitary linear formula y=a+bts of the row time y on numbering t;
Rate of rise using b as the average performance times of the current second business SQL statement.
Optionally, the computing unit, it is additionally operable to set the rate of rise of average performance times less than or equal to described first The second business SQL statement of threshold value is determined as the 3rd business SQL statement;According to the unitary of each 3rd business SQL statement Linear formula predicts corresponding 3rd business SQL statement being averaged in next collection period of the current collection period respectively Perform the time;According to each 3rd business SQL statement of acquisition the current collection period next collection period Interior total execution time and total actual average performance times for performing number, calculating corresponding 3rd business SQL statement;Calculate every Actual average performance times of the individual 3rd business SQL statement in next collection period of the current collection period With the ratio of the average performance times of prediction;
The identifying unit, it is additionally operable to judge that the 3rd business SQL that ratio is more than the second given threshold is abnormal SQL languages Sentence.
Specifically, the computing unit, is fitted using simple regression analysis method for two tuples according to foundation and worked as Unitary linear formula y=a+bts of the average performance times y of preceding second business SQL statement on numbering t, is specifically used for:
B and a are obtained by following equation:
Wherein,Adopted for the current second business SQL statement in the current collection period and each described select Collect the average value of the average performance times in the cycle,For the average value of the numbering of the current second business SQL statement,For The numbering of the current second business SQL statement square average value.
A kind of server is also provided, including:
First processor, for obtain total execution time of each first business SQL statement in current collection period and It is total to perform number, total execution time of acquisition is sorted according to order from big to small, it is total before the first setting number The first business SQL statement corresponding to the time is performed as the second business SQL statement;Obtain each second business SQL statement Total execution time and total execution number in the selected collection period of the second setting number before the current collection period; According to each second business SQL statement always holding in the current collection period and each selected collection period Row time and total rate of rise for performing number, calculating the average performance times of corresponding second business SQL statement;
Second processor, the growth speed of the average performance times for judging each second business SQL statement respectively Whether rate is more than the first given threshold, judges that the rate of rise of average performance times is more than the second industry of first given threshold Business SQL statement is abnormal SQL statement.
Specifically, first processor, for obtaining total execution of each first business SQL statement in current collection period Time and total execution number, are specifically used for:
The execution time of each first business SQL statement of continuous collecting and execution number;
By the execution time of each first business SQL statement gathered after the current collection period expires, subtract Go in the execution of correspondence the first business SQL statement gathered after the previous collection period of the current collection period expires Between, obtain total execution time of the corresponding first business SQL statement in the current collection period;And
By the execution number of each first business SQL statement gathered after the current collection period expires, subtract The execution time of correspondence the first business SQL statement gathered is gone after the previous collection period of the current collection period expires Number, obtain total execution number of the corresponding first business SQL statement in the current collection period.
Specifically, the first processor, for all in the current collection according to each second business SQL statement Phase and total execution time in each selected collection period and total execution number, calculate corresponding second business SQL statement Average performance times rate of rise, be specifically used for:
According to each second business SQL statement in the current collection period and each selected collection period Interior total execution time and always execution number, the corresponding second business SQL statement of calculating is in the currently collection period and each Average performance times in the selected collection period;
According to each second business SQL statement in the current collection period and each selected collection period Interior average performance times, calculate the rate of rise of the average performance times of corresponding second business SQL statement.
Specifically, the first processor, for all in the current collection according to each second business SQL statement Average performance times in phase and each selected collection period, calculate the average execution of corresponding second business SQL statement The rate of rise of time, is specifically used for:
For each second business SQL statement, perform:
The current collection period and each selected collection period are numbered according to time order and function order, established Number two tuples with corresponding average performance times;
Current being averaged for second business SQL statement is fitted according to two tuples of foundation using simple regression analysis method to hold Unitary linear formula y=a+bts of the row time y on numbering t;
Rate of rise using b as the average performance times of the current second business SQL statement.
Specifically, the first processor, is additionally operable to:
Using the rate of rise of average performance times be less than or equal to first given threshold the second business SQL statement as 3rd business SQL statement;
Predict corresponding 3rd business SQL statement respectively according to the unitary linear formula of each 3rd business SQL statement Average performance times in next collection period of the current collection period;
According to each 3rd business SQL statement of acquisition in next collection period of the current collection period Total execution time and total actual average performance times for performing number, calculating corresponding 3rd business SQL statement;
Calculate reality of each 3rd business SQL statement in next collection period of the current collection period Average performance times with prediction average performance times ratio;
The second processor, it is additionally operable to judge that the 3rd business SQL that ratio is more than the second given threshold is abnormal SQL languages Sentence.
Specifically, the first processor, is fitted for two tuples according to foundation using simple regression analysis method Unitary linear formula y=a+bts of the average performance times y of current second business SQL statement on numbering t, is specifically used for:
B and a are obtained by following equation:
Wherein,Adopted for the current second business SQL statement in the current collection period and each described select Collect the average value of the average performance times in the cycle,For the average value of the numbering of the current second business SQL statement,For The numbering of the current second business SQL statement square average value.
Abnormal SQL statement provided in an embodiment of the present invention determines method and server, and the program can obtain first to be worked as Time larger the first business SQL statement is always performed in preceding collection period as the second business SQL statement, then according to each the Total execution time of the two business SQL statements in the selected collection period before current collection period and current collection period and It is total to perform number, the rate of rise of the average performance times of each second business SQL statement is calculated, judges average performance times Rate of rise be more than the first given threshold the second business SQL statement be abnormal SQL statement, so as to according to historical record Business SQL statement total execution time and total number that performs determine abnormal SQL statement, be consumed in substantial amounts of system resource Abnormal SQL statement is assured that out before being affected with Consumer's Experience, effectively avoids the abnormal substantial amounts of system of SQL statement consumption Resource of uniting and influence Consumer's Experience, ensure that system operation is normal and Consumer's Experience is good.
Brief description of the drawings
Fig. 1 is the flow chart that abnormal SQL statement determines method in the embodiment of the present invention;
Fig. 2 is that the unitary linear formula of three the second business SQL statements fitted in the embodiment of the present invention is sat at right angle Straight line schematic diagram in mark system;
Fig. 3 is the signal of the average performance times of sql3 prediction and actual average performance times in the embodiment of the present invention Figure;
Fig. 4 is the structural representation of the first server in the embodiment of the present invention;
Fig. 5 is the structural representation of second of server in the embodiment of the present invention.
Embodiment
Abnormal SQL statement is determined in advance in order to realize, substantial amounts of system resource is consumed so as to prevent abnormal SQL statement With influence Consumer's Experience, the embodiment of the present invention provides a kind of abnormal SQL statement and determines method, the flow of this method as shown in figure 1, It is as follows to perform step:
S10:Total execution time of each first business SQL statement in current collection period and total execution number are obtained, Total execution time of acquisition is sorted according to order from big to small, total execution time before the first setting number is corresponding The first business SQL statement as the second business SQL statement.
The key technical indexes of the first business SQL statement execution efficiency, which can be reflected, to be had a lot:It is total to perform number, total execution Time, average performance times, processing time, logic reading, physical read, sequence, parsing number(parse calls), lock wait when Between, executive plan etc..Average performance times are to judge the first most important index of business SQL statement execution efficiency, therefore are judged Abnormal SQL statement has mainly used average performance times, obtain the first business SQL statement average performance times when, it is necessary to First choice obtains total execution time and total execution number in a period of time.Can be in units of collection period, in each collection Cycle determines total execution time of each first business SQL statement and total execution number after expiring, and collection period can be according to need Set, for example, it can be set to 0.5 hour, 1 hour, 2 hours etc..
So after current collection period expires, it is possible to obtain all first business SQL statements in current collection period Interior total execution time and total execution number, the first business SQL statement for only always performing overlong time are possible to be abnormal SQL statement, therefore, can first by total execution time of all first business SQL statements in current collection period according to from Small order sequence is arrived greatly, since always being performed time maximum, obtains the first business SQL statement conduct of the first setting number Second business SQL statement.First setting number can be set as needed, such as can be set to 1000,1500, 3000 etc..
S11:Obtain the selected collection of second setting number of each second business SQL statement before current collection period Total execution time and total execution number in cycle.
Except obtaining total execution time and total execution number of each second business SQL statement in current collection period, Also need to obtain each second business SQL statement in the selected collection period of the second setting number before current collection period Total execution time and it is total perform number, the second setting number can be set according to being actually needed, such as can be set to 20 It is individual, 30,40 etc..
S12:According to each second business SQL statement always holding in current collection period and each selected collection period Row time and total rate of rise for performing number, calculating the average performance times of corresponding second business SQL statement.
S13:Judge whether the rate of rise of the average performance times of each second business SQL statement sets more than first respectively Threshold value is determined, if so, performing S14;Otherwise, S15 is performed.
First given threshold can be set according to actual conditions, such as being averaged with each first business SQL statement It is criterion that the execution time, which monthly increased no more than 0.1 second, if collection period is 1 hour, the first given threshold can Think 0.1/24/30=1/7200=0.00014 second.
S14:The second business SQL statement that the rate of rise of judgement average performance times is more than the first given threshold is exception SQL statement.
The growth rate of average performance times is more than the first given threshold, also indicates that the second being averaged for business SQL statement is held The row time increases too fast, then can the second business SQL statement is determined as abnormal SQL statement.
S15:Using the rate of rise of average performance times be less than or equal to the first given threshold the second business SQL statement as 3rd business SQL statement.
S16:Predict corresponding 3rd business SQL statement respectively according to the unitary linear formula of each 3rd business SQL statement Average performance times in next collection period of current collection period.
The unitary linear formula of each 3rd business SQL statement can be fitted, so as to corresponding 3rd industry of can prediction Average performance times of the business SQL statement in next collection period of current collection period.
S17:It is total in next collection period of current collection period according to each 3rd business SQL statement of acquisition Perform time and total actual average performance times for performing number, calculating corresponding 3rd business SQL statement.
S18:It is actual flat in next collection period of current collection period to calculate each 3rd business SQL statement It is performed both by time and the ratio of the average performance times of prediction.
S19:The 3rd business SQL that ratio is more than the second given threshold is abnormal SQL statement.
Under normal circumstances, because the conditions such as system load and service concurrence limit, the average execution of the second business SQL statement It is normal that, which there is different time, but if difference is excessive, is then possible for abnormal SQL statement.Second given threshold can be with Set as needed, such as be set as 1.2,1.3,1.5,1.6 etc..
The program can obtain the first larger business SQL statement conduct of total execution time in current collection period first Second business SQL statement, then according to each second business SQL statement before current collection period and current collection period Selected collection period in total execution time and it is total perform number, calculate the average execution of each second business SQL statement The rate of rise of time, the rate of rise for judging average performance times are more than the second business SQL statement of the first given threshold Abnormal SQL statement, total execution time and total execution number so as to the business SQL statement according to historical record are determined different Normal SQL statement, abnormal SQL languages are assured that out before substantial amounts of system resource is consumed and is affected with Consumer's Experience Sentence, effectively avoid abnormal SQL statement from consuming substantial amounts of system resource and influence Consumer's Experience, ensure system normal operation and user Experience is good.
Specifically, total execution time of each first business SQL statement of acquisition in current collection period in above-mentioned S10 Number is performed with total, is specifically included:
The execution time of each first business SQL statement of continuous collecting and execution number;
By the execution time of each first business SQL statement gathered after current collection period expires, subtract current The execution time for correspondence the first business SQL statement that the previous collection period of collection period gathers after expiring, obtain corresponding the Total execution time of the one business SQL statement in current collection period;And
By the execution number of each first business SQL statement gathered after current collection period expires, subtract current The execution number for correspondence the first business SQL statement that the previous collection period of collection period gathers after expiring, obtain corresponding the Total execution number of the one business SQL statement in current collection period.
Execution time that can be by each first business SQL statement of dynamic view etc. mode continuous collecting and execution time Number, then by the execution time of each first business SQL statement gathered after current collection period expires, subtract and adopted currently The execution time for correspondence the first business SQL statement that the previous collection period in collection cycle gathers after expiring, obtain corresponding first Total execution time of the business SQL statement in current collection period.Corresponding first business SQL can also be obtained with identical method Total execution number of the sentence in current collection period.
Specifically, each second business SQL statement of basis in above-mentioned S12 is adopted in current collection period and each select Collect total execution time in the cycle and total growth for performing number, calculating the average performance times of corresponding second business SQL statement Speed, specifically include:
During according to total execution of each second business SQL statement in current collection period and each selected collection period Between and it is total perform number, calculate corresponding second business SQL statement in current collection period and each in selected collection period Average performance times;
According to average execution of each second business SQL statement in current collection period and each selected collection period Time, calculate the rate of rise of the average performance times of corresponding second business SQL statement.
Specifically, the above-mentioned each second business SQL statement of basis selectes collection period in current collection period and each Interior average performance times, the rate of rise of the average performance times of corresponding second business SQL statement is calculated, is specifically included:
For each second business SQL statement, perform:
According to time order and function order, to current collection period and each, selected collection period is numbered, establish numbering with it is right Two tuples of the average performance times answered;
Current being averaged for second business SQL statement is fitted according to two tuples of foundation using simple regression analysis method to hold Unitary linear formula y=a+bts of the row time y on numbering t;
Rate of rise using b as the average performance times of current second business SQL statement.
Specifically, above-mentioned two tuples according to foundation fit current second business SQL using simple regression analysis method Unitary linear formula y=a+bts of the average performance times y of sentence on numbering t, is specifically included:
B and a are obtained by following equation:
Wherein, y is current second business SQL statement being averaged in current collection period and each selected collection period The average value of time is performed,For the average value of the numbering of current second business SQL statement,For current second business SQL languages Sentence numbering square average value.
Below using collection period as 1 hour, the number of current collection period and selected collection period is said exemplified by being 20 It is bright, it is assumed that some second business SQL statement is carried out according to time order and function order to current collection period and selected collection period Average performance times in numbering and corresponding collection period are as shown in the table:
Numbering Average performance times
1 2.091
2 2.079
3 2.099
4 2.134
5 2.183
6 2.193
7 2.195
8 2.236
9 2.214
10 2.265
11 2.331
12 2.354
13 2.378
14 2.42
15 2.465
16 2.428
17 2.416
18 2.474
19 2.53
20 2.546
20 two tuples then can be obtained according to upper table(1,2.091)、……、(20,2.546), utilize simple regression point Analysis method carries out linear fit, obtains equation below y=0.0252t+2.0369, can be by the formula to the subsequent acquisition cycle Interior average performance times are predicted, and during such as t=30, i.e. after 10 hours, average performance times are:y=2.0369+ 0.0252*30=2.8 second.
After the unitary linear formula of each second business SQL statement is obtained, b in unitary linear formula can be passed through first Value determine the second business SQL statement average performance times growth rate, be illustrated in figure 2 three the second industry fitted Business SQL statement(Sql2, sql4, sql4 are designated as respectively)Straight line of the unitary linear formula in rectangular coordinate system, sql1 is just Straight line in the case of often, is a gentle straight line, and sql1 average performance times slowly increase, and during sql2 average execution Between growth rate be 0.001, sql3 average performance times growth rate be 0.00003, sql4 average performance times increasing Long rate is 0.003.If it is abnormal SQL statement that the first given threshold, which is 0.00014, sql2 and sql4, sql3 is normal SQL Sentence.For sql2 and sql4, generally executive plan is full table scan, and data are more and more in table causes.
For sql3, because b value is not above 0.00014, then it is pre- that corresponding unitary linear formula can be continued through Average performance times in next collection period are surveyed, it can be seen in figure 3 that at the time point of t=275 according to fitting formula y =0.001t+0.4994, the execution time that can predict the time point of t=276 are 0.7754 second, and at the time point of t=276, it is actual Average performance times are 1.492 seconds, and the ratio of actual average performance times and the average performance times of prediction has exceeded 1.2 (Assuming that the second given threshold is 1.2), then sql3 is abnormal SQL statement.General reason is executive plan suddenly change, or simultaneously Hair causes Database lock.
After abnormal SQL statement is determined, Producing reason can also be analyzed, optimizes solution in advance, keeper can Analyze the other key indexs of abnormal SQL statement being collected into further, if for example, the lock stand-by period have compared to before it is bright Aobvious to increase, this specification exception SQL statement is due to that business lock causes, it is necessary to change the service logic of application program, so as to Abnormal SQL statement is rapidly eliminated, ensures the normal operation and Consumer's Experience of system.
Based on same inventive concept, the embodiment of the present invention provides a kind of server, the structure of the server as shown in figure 4, Including:
First acquisition unit 41, during for obtaining total execution of each first business SQL statement in current collection period Between and it is total perform number, total execution time of acquisition is sorted according to order from big to small, before the first setting number Total execution time corresponding to the first business SQL statement as the second business SQL statement;
Second acquisition unit 42, for obtaining each second business SQL statement second setting before current collection period Determine total execution time in the selected collection period of number and total execution number;
Computing unit 43, for being gathered according to each second business SQL statement in current collection period and each select Total execution time and total growth speed for performing number, calculating the average performance times of corresponding second business SQL statement in cycle Rate;
Identifying unit 44, for judging that the rate of rise of average performance times of each second business SQL statement is respectively It is no to be more than the first given threshold, judge that the rate of rise of average performance times is more than the second business SQL languages of the first given threshold Sentence is abnormal SQL statement.
Specifically, above-mentioned first acquisition unit 41, for obtaining each first business SQL statement in current collection period Total execution time and it is total perform number, be specifically used for:
The execution time of each first business SQL statement of continuous collecting and execution number;
By the execution time of each first business SQL statement gathered after current collection period expires, subtract current The execution time for correspondence the first business SQL statement that the previous collection period of collection period gathers after expiring, obtain corresponding the Total execution time of the one business SQL statement in current collection period;And
By the execution number of each first business SQL statement gathered after current collection period expires, subtract current The execution number for correspondence the first business SQL statement that the previous collection period of collection period gathers after expiring, obtain corresponding the Total execution number of the one business SQL statement in current collection period.
Specifically, above-mentioned computing unit 43, is specifically used for:
During according to total execution of each second business SQL statement in current collection period and each selected collection period Between and it is total perform number, calculate corresponding second business SQL statement in current collection period and each in selected collection period Average performance times;
According to average execution of each second business SQL statement in current collection period and each selected collection period Time, calculate the rate of rise of the average performance times of corresponding second business SQL statement.
Specifically, above-mentioned computing unit 43, for according to each second business SQL statement in current collection period and every Average performance times in individual selected collection period, calculate the growth speed of the average performance times of corresponding second business SQL statement Rate, it is specifically used for:
For each second business SQL statement, perform:
According to time order and function order, to current collection period and each, selected collection period is numbered, establish numbering with it is right Two tuples of the average performance times answered;
Current being averaged for second business SQL statement is fitted according to two tuples of foundation using simple regression analysis method to hold Unitary linear formula y=a+bts of the row time y on numbering t;
Rate of rise using b as the average performance times of current second business SQL statement.
Specifically, above-mentioned computing unit 43, is additionally operable to the rate of rise of average performance times being less than or equal to the first setting Second business SQL statement of threshold value is as the 3rd business SQL statement;It is linearly public according to the unitary of each 3rd business SQL statement Formula predicts average performance times of the corresponding 3rd business SQL statement in next collection period of current collection period respectively; According to total execution time of each 3rd business SQL statement of acquisition in next collection period of current collection period and always Number is performed, calculates the actual average performance times of corresponding 3rd business SQL statement;Calculate each 3rd business SQL statement The ratio of actual average performance times and the average performance times of prediction in next collection period of current collection period Value;
Identifying unit 44, it is additionally operable to judge that the 3rd business SQL that ratio is more than the second given threshold is abnormal SQL statement.
Specifically, above-mentioned computing unit 43, is fitted for two tuples according to foundation using simple regression analysis method Unitary linear formula y=a+bts of the average performance times y of current second business SQL statement on numbering t, is specifically used for:
B and a are obtained by following equation:
Wherein,It is flat in current collection period and each selected collection period for current second business SQL statement The average value of time is performed both by,For the average value of the numbering of current second business SQL statement,For current second business SQL The numbering of sentence square average value.
Based on same inventive concept, the embodiment of the present invention provides a kind of server, the structure of the server as shown in figure 5, Including:
First processor 51, for obtaining total execution time of each first business SQL statement in current collection period Number is performed with total, total execution time of acquisition is sorted according to order from big to small, before the first setting number It is total to perform the first business SQL statement corresponding to the time as the second business SQL statement;Each second business SQL statement is obtained to exist Total execution time and total execution number in the selected collection period of the second setting number before current collection period;According to every Total execution time and total execution time of the individual second business SQL statement in current collection period and each selected collection period Number, calculate the rate of rise of the average performance times of corresponding second business SQL statement;
Second processor 52, the rate of rise of the average performance times for judging each second business SQL statement respectively Whether it is more than the first given threshold, judges that the rate of rise of average performance times is more than the second business SQL of the first given threshold Sentence is abnormal SQL statement.
Specifically, above-mentioned first processor 51, for obtaining each first business SQL statement in current collection period It is total to perform time and total execution number, it is specifically used for:
The execution time of each first business SQL statement of continuous collecting and execution number;
By the execution time of each first business SQL statement gathered after current collection period expires, subtract current The execution time for correspondence the first business SQL statement that the previous collection period of collection period gathers after expiring, obtain corresponding the Total execution time of the one business SQL statement in current collection period;And
By the execution number of each first business SQL statement gathered after current collection period expires, subtract current The execution number for correspondence the first business SQL statement that the previous collection period of collection period gathers after expiring, obtain corresponding the Total execution number of the one business SQL statement in current collection period.
Specifically, above-mentioned first processor 51, for according to each second business SQL statement in current collection period and Total execution time and total average execution for performing number, calculating corresponding second business SQL statement in each selected collection period The rate of rise of time, is specifically used for:
During according to total execution of each second business SQL statement in current collection period and each selected collection period Between and it is total perform number, calculate corresponding second business SQL statement in current collection period and each in selected collection period Average performance times;
According to average execution of each second business SQL statement in current collection period and each selected collection period Time, calculate the rate of rise of the average performance times of corresponding second business SQL statement.
Specifically, above-mentioned first processor 51, for according to each second business SQL statement in current collection period and Average performance times in each selected collection period, calculate the growth of the average performance times of corresponding second business SQL statement Speed, it is specifically used for:
For each second business SQL statement, perform:
According to time order and function order, to current collection period and each, selected collection period is numbered, establish numbering with it is right Two tuples of the average performance times answered;
Current being averaged for second business SQL statement is fitted according to two tuples of foundation using simple regression analysis method to hold Unitary linear formula y=a+bts of the row time y on numbering t;
Rate of rise using b as the average performance times of current second business SQL statement.
Specifically, above-mentioned first processor 51, is additionally operable to:
The rate of rise of average performance times is less than or equal to the second business SQL statement of the first given threshold as the 3rd Business SQL statement;
Predict that corresponding 3rd business SQL statement is being worked as respectively according to the unitary linear formula of each 3rd business SQL statement Average performance times in next collection period of preceding collection period;
According to total execution of each 3rd business SQL statement of acquisition in next collection period of current collection period Time and total actual average performance times for performing number, calculating corresponding 3rd business SQL statement;
Actual be averaged of each 3rd business SQL statement in next collection period of current collection period is calculated to hold Row time and the ratio of the average performance times of prediction;
Second processor 52, it is additionally operable to judge that the 3rd business SQL that ratio is more than the second given threshold is abnormal SQL languages Sentence.
Specifically, above-mentioned first processor 51, for being fitted according to two tuples of foundation using simple regression analysis method Go out unitary linear formula y=a+bts of the average performance times y on numbering t of current second business SQL statement, be specifically used for:
B and a are obtained by following equation:
Wherein,It is flat in current collection period and each selected collection period for current second business SQL statement The average value of time is performed both by,For the average value of the numbering of current second business SQL statement,For current second business SQL The numbering of sentence square average value.
The present invention is with reference to method according to embodiments of the present invention, equipment(System)And the flow of computer program product Figure and/or block diagram describe.It should be understood that can be by every first-class in computer program instructions implementation process figure and/or block diagram Journey and/or the flow in square frame and flow chart and/or block diagram and/or the combination of square frame.These computer programs can be provided The processors of all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing devices is instructed to produce A raw machine so that produced by the instruction of computer or the computing device of other programmable data processing devices for real The device for the function of being specified in present one flow of flow chart or one square frame of multiple flows and/or block diagram or multiple square frames.
These computer program instructions, which may be alternatively stored in, can guide computer or other programmable data processing devices with spy Determine in the computer-readable memory that mode works so that the instruction being stored in the computer-readable memory, which produces, to be included referring to Make the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one square frame of block diagram or The function of being specified in multiple square frames.
These computer program instructions can be also loaded into computer or other programmable data processing devices so that counted Series of operation steps is performed on calculation machine or other programmable devices to produce computer implemented processing, so as in computer or The instruction performed on other programmable devices is provided for realizing in one flow of flow chart or multiple flows and/or block diagram one The step of function of being specified in individual square frame or multiple square frames.
Although having been described for the alternative embodiment of the present invention, those skilled in the art once know basic creation Property concept, then can make other change and modification to these embodiments.So be intended to be construed to include can for appended claims Select embodiment and fall into having altered and changing for the scope of the invention.
Obviously, those skilled in the art can carry out various changes and modification without departing from this hair to the embodiment of the present invention The spirit and scope of bright embodiment.So, if these modifications and variations of the embodiment of the present invention belong to the claims in the present invention And its within the scope of equivalent technologies, then the present invention is also intended to comprising including these changes and modification.

Claims (18)

1. a kind of anomaly sxtructure query language SQL statement determines method, it is characterised in that including:
Total execution time of each first business SQL statement in current collection period and total execution number are obtained, by acquisition It is total to perform the time according to order sequence from big to small, the first industry corresponding to total execution time before the first setting number SQL statement be engaged in as the second business SQL statement;
Obtain the selected collection of second setting number of each second business SQL statement before the current collection period Total execution time and total execution number in cycle;
According to each second business SQL statement in the current collection period and each selected collection period It is total to perform time and total rate of rise for performing number, calculating the average performance times of corresponding second business SQL statement;
Judge whether the rate of rise of the average performance times of each second business SQL statement is more than the first setting threshold respectively Value, judge average performance times rate of rise be more than first given threshold the second business SQL statement be abnormal SQL languages Sentence.
2. the method as described in claim 1, it is characterised in that obtain each first business SQL statement in current collection period Interior total execution time and total execution number, are specifically included:
The execution time of each first business SQL statement of continuous collecting and execution number;
By the execution time of each first business SQL statement gathered after the current collection period expires, subtract The execution time for correspondence the first business SQL statement that the previous collection period of the current collection period gathers after expiring, obtain To total execution time of the corresponding first business SQL statement in the current collection period;And
By the execution number of each first business SQL statement gathered after the current collection period expires, subtract The execution number for correspondence the first business SQL statement that the previous collection period of the current collection period gathers after expiring, is obtained To total execution number of the corresponding first business SQL statement in the current collection period.
3. the method as described in claim 1, it is characterised in that according to each second business SQL statement described current Collection period and total execution time in each selected collection period and total execution number, calculate corresponding second business The rate of rise of the average performance times of SQL statement, is specifically included:
According to each second business SQL statement in the current collection period and each selected collection period Time and always execution number are always performed, the corresponding second business SQL statement of calculating is described in the current collection period and each Average performance times in selected collection period;
According to each second business SQL statement in the current collection period and each selected collection period Average performance times, calculate the rate of rise of the average performance times of corresponding second business SQL statement.
4. method as claimed in claim 3, it is characterised in that according to each second business SQL statement described current Average performance times in collection period and each selected collection period, calculate the flat of corresponding second business SQL statement The rate of rise of time is performed both by, is specifically included:
For each second business SQL statement, perform:
The current collection period and each selected collection period are numbered according to time order and function order, establish numbering With two tuples of corresponding average performance times;
When fitting the average execution of current second business SQL statement using simple regression analysis method according to two tuples of foundation Between unitary linear formula y=a+bts of the y on numbering t;
Rate of rise using b as the average performance times of the current second business SQL statement.
5. method as claimed in claim 4, it is characterised in that also include:
The rate of rise of average performance times is less than or equal to the second business SQL statement of first given threshold as the 3rd Business SQL statement;
Predicted corresponding 3rd business SQL statement in institute respectively according to the unitary linear formula of each 3rd business SQL statement State the average performance times in next collection period of current collection period;
It is total in next collection period of the current collection period according to each 3rd business SQL statement of acquisition Perform time and total actual average performance times for performing number, calculating corresponding 3rd business SQL statement;
It is actual flat in next collection period of the current collection period to calculate each 3rd business SQL statement Time and the ratio of the average performance times of prediction are performed both by, the 3rd business SQL that ratio is more than the second given threshold is abnormal SQL statement.
6. the method as described in claim 4 or 5, it is characterised in that utilize simple regression analysis side according to two tuples of foundation Method fits unitary linear formula y=a+bts of the average performance times y on numbering t of current second business SQL statement, specifically Including:
B and a are obtained by following equation:
<mrow> <mi>b</mi> <mo>=</mo> <mfrac> <mrow> <mover> <mi>y</mi> <mo>&amp;OverBar;</mo> </mover> <mo>-</mo> <mover> <mi>y</mi> <mo>&amp;OverBar;</mo> </mover> <mo>&amp;times;</mo> <mover> <mi>t</mi> <mo>&amp;OverBar;</mo> </mover> </mrow> <mrow> <mover> <msup> <mi>t</mi> <mn>2</mn> </msup> <mo>&amp;OverBar;</mo> </mover> <mo>-</mo> <msup> <mrow> <mo>(</mo> <mover> <mi>t</mi> <mo>&amp;OverBar;</mo> </mover> <mo>)</mo> </mrow> <mn>2</mn> </msup> </mrow> </mfrac> <mo>;</mo> </mrow>
<mrow> <mi>a</mi> <mo>=</mo> <mover> <mi>y</mi> <mo>&amp;OverBar;</mo> </mover> <mo>-</mo> <mi>b</mi> <mo>&amp;times;</mo> <mover> <mi>t</mi> <mo>&amp;OverBar;</mo> </mover> <mo>;</mo> </mrow>
Wherein,It is the current second business SQL statement in the current collection period and each selected collection period The average value of interior average performance times,For the average value of the numbering of the current second business SQL statement,Work as to be described The numbering of preceding second business SQL statement square average value.
A kind of 7. server, it is characterised in that including:
First acquisition unit, for obtaining total execution time of each first business SQL statement in current collection period and total Number is performed, total execution time of acquisition is sorted according to order from big to small, always holding before the first setting number The first business SQL statement is as the second business SQL statement corresponding to the row time;
Second acquisition unit, for obtaining each second business SQL statement second before the current collection period Set total execution time in the selected collection period of number and total execution number;
Computing unit, for each second business SQL statement of basis in the current collection period and each choosing Determine total execution time in collection period and total execution number, calculate the average performance times of corresponding second business SQL statement Rate of rise;
Identifying unit, for judge respectively each second business SQL statement average performance times rate of rise whether More than the first given threshold, judge that the rate of rise of average performance times is more than the second business SQL of first given threshold Sentence is abnormal SQL statement.
8. server as claimed in claim 7, it is characterised in that the first acquisition unit, for obtaining each first industry It is engaged in total execution time and total execution number of the SQL statement in current collection period, is specifically used for:
The execution time of each first business SQL statement of continuous collecting and execution number;
By the execution time of each first business SQL statement gathered after the current collection period expires, subtract The execution time for correspondence the first business SQL statement that the previous collection period of the current collection period gathers after expiring, obtain To total execution time of the corresponding first business SQL statement in the current collection period;And
By the execution number of each first business SQL statement gathered after the current collection period expires, subtract The execution number for correspondence the first business SQL statement that the previous collection period of the current collection period gathers after expiring, is obtained To total execution number of the corresponding first business SQL statement in the current collection period.
9. server as claimed in claim 7, it is characterised in that the computing unit, be specifically used for:
According to each second business SQL statement in the current collection period and each selected collection period Time and always execution number are always performed, the corresponding second business SQL statement of calculating is described in the current collection period and each Average performance times in selected collection period;
According to each second business SQL statement in the current collection period and each selected collection period Average performance times, calculate the rate of rise of the average performance times of corresponding second business SQL statement.
10. server as claimed in claim 9, it is characterised in that the computing unit, for according to each second industry Average performance times of the business SQL statement in the current collection period and each selected collection period, are calculated corresponding The rate of rise of the average performance times of second business SQL statement, is specifically used for:
For each second business SQL statement, perform:
The current collection period and each selected collection period are numbered according to time order and function order, establish numbering With two tuples of corresponding average performance times;
When fitting the average execution of current second business SQL statement using simple regression analysis method according to two tuples of foundation Between unitary linear formula y=a+bts of the y on numbering t;
Rate of rise using b as the average performance times of the current second business SQL statement.
11. server as claimed in claim 10, it is characterised in that the computing unit, be additionally operable to average performance times Rate of rise be less than or equal to first given threshold the second business SQL statement as the 3rd business SQL statement;According to every The unitary linear formula of the individual 3rd business SQL statement predicts corresponding 3rd business SQL statement in the current collection respectively Average performance times in next collection period in cycle;According to each 3rd business SQL statement of acquisition described Total execution time and total execution number in next collection period of current collection period, calculate corresponding 3rd business SQL languages The actual average performance times of sentence;Each 3rd business SQL statement is calculated in the next of the current collection period The ratio of actual average performance times and the average performance times of prediction in collection period;
The identifying unit, it is additionally operable to judge that the 3rd business SQL that ratio is more than the second given threshold is abnormal SQL statement.
12. the server as described in claim 10 or 11, it is characterised in that the computing unit, for two according to foundation Tuple fits one of the average performance times y of current second business SQL statement on numbering t using simple regression analysis method First linear formula y=a+bt, is specifically used for:
B and a are obtained by following equation:
<mrow> <mi>b</mi> <mo>=</mo> <mfrac> <mrow> <mover> <mi>y</mi> <mo>&amp;OverBar;</mo> </mover> <mo>-</mo> <mover> <mi>y</mi> <mo>&amp;OverBar;</mo> </mover> <mo>&amp;times;</mo> <mover> <mi>t</mi> <mo>&amp;OverBar;</mo> </mover> </mrow> <mrow> <mover> <msup> <mi>t</mi> <mn>2</mn> </msup> <mo>&amp;OverBar;</mo> </mover> <mo>-</mo> <msup> <mrow> <mo>(</mo> <mover> <mi>t</mi> <mo>&amp;OverBar;</mo> </mover> <mo>)</mo> </mrow> <mn>2</mn> </msup> </mrow> </mfrac> <mo>;</mo> </mrow>
<mrow> <mi>a</mi> <mo>=</mo> <mover> <mi>y</mi> <mo>&amp;OverBar;</mo> </mover> <mo>-</mo> <mi>b</mi> <mo>&amp;times;</mo> <mover> <mi>t</mi> <mo>&amp;OverBar;</mo> </mover> <mo>;</mo> </mrow>
Wherein,It is that the current second business SQL statement is all in the current collection period and each selected collection The average value of average performance times in phase,For the average value of the numbering of the current second business SQL statement,To be described The numbering of current second business SQL statement square average value.
A kind of 13. server, it is characterised in that including:
First processor, for obtaining total execution time of each first business SQL statement in current collection period and always holding Places number, total execution time of acquisition is sorted according to order from big to small, total execution before the first setting number The first business SQL statement is as the second business SQL statement corresponding to time;Each second business SQL statement is obtained in institute Total execution time and total execution number in the selected collection period of the second setting number before stating current collection period;According to During total execution of each second business SQL statement in the current collection period and each selected collection period Between and total rate of rise for performing number, calculating the average performance times of corresponding second business SQL statement;
Second processor, for judging that the rate of rise of average performance times of each second business SQL statement is respectively It is no to be more than the first given threshold, judge that the rate of rise of average performance times is more than the second business of first given threshold SQL statement is abnormal SQL statement.
14. server as claimed in claim 13, it is characterised in that first processor, for obtaining each first business SQL Total execution time of the sentence in current collection period and total execution number, are specifically used for:
The execution time of each first business SQL statement of continuous collecting and execution number;
By the execution time of each first business SQL statement gathered after the current collection period expires, subtract The execution time for correspondence the first business SQL statement that the previous collection period of the current collection period gathers after expiring, obtain To total execution time of the corresponding first business SQL statement in the current collection period;And
By the execution number of each first business SQL statement gathered after the current collection period expires, subtract The execution number for correspondence the first business SQL statement that the previous collection period of the current collection period gathers after expiring, is obtained To total execution number of the corresponding first business SQL statement in the current collection period.
15. server as claimed in claim 13, it is characterised in that the first processor, for according to each described the Total execution time and total execution of the two business SQL statements in the current collection period and each selected collection period Number, the rate of rise of the average performance times of corresponding second business SQL statement is calculated, is specifically used for:
According to each second business SQL statement in the current collection period and each selected collection period Time and always execution number are always performed, the corresponding second business SQL statement of calculating is described in the current collection period and each Average performance times in selected collection period;
According to each second business SQL statement in the current collection period and each selected collection period Average performance times, calculate the rate of rise of the average performance times of corresponding second business SQL statement.
16. server as claimed in claim 15, it is characterised in that the first processor, for according to each described the Average performance times of the two business SQL statements in the current collection period and each selected collection period, are calculated The rate of rise of the average performance times of corresponding second business SQL statement, is specifically used for:
For each second business SQL statement, perform:
The current collection period and each selected collection period are numbered according to time order and function order, establish numbering With two tuples of corresponding average performance times;
When fitting the average execution of current second business SQL statement using simple regression analysis method according to two tuples of foundation Between unitary linear formula y=a+bts of the y on numbering t;
Rate of rise using b as the average performance times of the current second business SQL statement.
17. server as claimed in claim 16, it is characterised in that the first processor, be additionally operable to:
The rate of rise of average performance times is less than or equal to the second business SQL statement of first given threshold as the 3rd Business SQL statement;
Predicted corresponding 3rd business SQL statement in institute respectively according to the unitary linear formula of each 3rd business SQL statement State the average performance times in next collection period of current collection period;
It is total in next collection period of the current collection period according to each 3rd business SQL statement of acquisition Perform time and total actual average performance times for performing number, calculating corresponding 3rd business SQL statement;
It is actual flat in next collection period of the current collection period to calculate each 3rd business SQL statement It is performed both by time and the ratio of the average performance times of prediction;
The second processor, it is additionally operable to judge that the 3rd business SQL that ratio is more than the second given threshold is abnormal SQL statement.
18. the server as described in claim 16 or 17, it is characterised in that the first processor, for according to foundation Two tuples fit the average performance times y of current second business SQL statement on numbering t's using simple regression analysis method Unitary linear formula y=a+bt, is specifically used for:
B and a are obtained by following equation:
<mrow> <mi>b</mi> <mo>=</mo> <mfrac> <mrow> <mover> <mi>y</mi> <mo>&amp;OverBar;</mo> </mover> <mo>-</mo> <mover> <mi>y</mi> <mo>&amp;OverBar;</mo> </mover> <mo>&amp;times;</mo> <mover> <mi>t</mi> <mo>&amp;OverBar;</mo> </mover> </mrow> <mrow> <mover> <msup> <mi>t</mi> <mn>2</mn> </msup> <mo>&amp;OverBar;</mo> </mover> <mo>-</mo> <msup> <mrow> <mo>(</mo> <mover> <mi>t</mi> <mo>&amp;OverBar;</mo> </mover> <mo>)</mo> </mrow> <mn>2</mn> </msup> </mrow> </mfrac> <mo>;</mo> </mrow>
<mrow> <mi>a</mi> <mo>=</mo> <mover> <mi>y</mi> <mo>&amp;OverBar;</mo> </mover> <mo>-</mo> <mi>b</mi> <mo>&amp;times;</mo> <mover> <mi>t</mi> <mo>&amp;OverBar;</mo> </mover> <mo>;</mo> </mrow>
Wherein,It is that the current second business SQL statement is all in the current collection period and each selected collection The average value of average performance times in phase,For the average value of the numbering of the current second business SQL statement,To be described The numbering of current second business SQL statement square average value.
CN201410018621.2A 2014-01-15 2014-01-15 Anomaly sxtructure query language SQL statement determines method and server Active CN104778185B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410018621.2A CN104778185B (en) 2014-01-15 2014-01-15 Anomaly sxtructure query language SQL statement determines method and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410018621.2A CN104778185B (en) 2014-01-15 2014-01-15 Anomaly sxtructure query language SQL statement determines method and server

Publications (2)

Publication Number Publication Date
CN104778185A CN104778185A (en) 2015-07-15
CN104778185B true CN104778185B (en) 2018-01-30

Family

ID=53619652

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410018621.2A Active CN104778185B (en) 2014-01-15 2014-01-15 Anomaly sxtructure query language SQL statement determines method and server

Country Status (1)

Country Link
CN (1) CN104778185B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107784003B (en) * 2016-08-26 2021-09-21 菜鸟智能物流控股有限公司 Data query anomaly detection method, device, equipment and system
CN107818093A (en) * 2016-09-12 2018-03-20 华为技术有限公司 A kind of localization method, the apparatus and system of SQL scripts
CN106682101B (en) * 2016-12-05 2019-09-20 福建天晴数码有限公司 A kind of database script is operating abnormally the method and system of detection
CN108628909B (en) * 2017-03-24 2022-04-12 北京京东尚科信息技术有限公司 Information pushing method and device
CN107391730B (en) * 2017-08-02 2020-09-08 苏州浪潮智能科技有限公司 SQL statement processing method and device
CN107609028B (en) * 2017-08-09 2021-10-15 山东中创软件商用中间件股份有限公司 Method and device for determining low-efficiency SQL statement
CN108804947B (en) * 2018-06-19 2020-06-05 上海点融信息科技有限责任公司 Method and device for determining white list for operating database
CN109542868A (en) * 2018-09-28 2019-03-29 中国平安人寿保险股份有限公司 Position method, apparatus, electronic equipment and the storage medium of abnormal SQL statement
CN110427259A (en) * 2019-08-05 2019-11-08 北京奇艺世纪科技有限公司 A kind of task processing method and device
CN113297249A (en) * 2021-01-25 2021-08-24 阿里云计算有限公司 Slow query statement identification and analysis method and device and query statement statistical method and device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101840352A (en) * 2010-04-29 2010-09-22 中兴通讯股份有限公司 Method and device for monitoring database connection pool
CN103186603A (en) * 2011-12-29 2013-07-03 ***通信集团浙江有限公司 Method, system and equipment for determining influence of SQL statements on performance of key businesses

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2401211B (en) * 2003-04-30 2005-07-20 Oracle Int Corp SQL join elimination

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101840352A (en) * 2010-04-29 2010-09-22 中兴通讯股份有限公司 Method and device for monitoring database connection pool
CN103186603A (en) * 2011-12-29 2013-07-03 ***通信集团浙江有限公司 Method, system and equipment for determining influence of SQL statements on performance of key businesses

Also Published As

Publication number Publication date
CN104778185A (en) 2015-07-15

Similar Documents

Publication Publication Date Title
CN104778185B (en) Anomaly sxtructure query language SQL statement determines method and server
US10216793B2 (en) Optimization of continuous queries in hybrid database and stream processing systems
US9934261B2 (en) Progress analyzer for database queries
US8874548B2 (en) Predicting query execution time
CN103902646B (en) Distributed task managing system and method
US6691099B1 (en) Method and system for histogram determination in a database
US9836504B2 (en) Query progress estimation based on processed value packets
Duggan et al. Contender: A Resource Modeling Approach for Concurrent Query Performance Prediction.
CN109254901B (en) A kind of Monitoring Indexes method and system
US10191947B2 (en) Partitioning advisor for online transaction processing workloads
US20120271845A1 (en) Processing records in dynamic ranges
CN111294819A (en) Network optimization method and device
CN110399377A (en) Optimization method, device, electronic equipment and the computer readable storage medium of SQL
CN110333983A (en) Business monitoring and searching service monitoring method and device
CN106354616A (en) Method and device for monitoring application execution performance and high-performance computing system
US8973000B2 (en) Determining multiprogramming levels
CN106909454B (en) Rule processing method and equipment
CN106339578A (en) Multi-strategy integration hospital patient registration recommendation method
CN103136440A (en) Method and device of data processing
CN106603661B (en) A kind of dynamic resource balance dispatching method suitable for cloud platform
CN116680289A (en) Distributed database index recommendation monitoring system and method
CN105302909B (en) Network security log system big data search method based on subregion calculations of offset
CN106487570A (en) A kind of method and apparatus of assessment network performance index variation tendency
CN110287114A (en) A kind of method and device of database script performance test
JP2012238207A (en) Data analysis system and data analysis method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
EXSB Decision made by sipo to initiate substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant