Server state detection method and device
Technical field
The present invention relates to computer fields, in particular to a kind of server state detection method and device.
Background technique
Nowadays, user usually accesses the business that provides on service server by client, in order to guarantee user can and
When obtain correct business information from service server, need constantly to detect the state of service server, for example, detection industry
Whether the load condition of business server itself receives illegal attack etc., to guarantee that service server can timely respond to client
Hold the access request sent.
Currently, generalling use following detection method to detect the state of service server:
S1: acquiring and the various performance parameters in statistical service server, for example, number of network connections, memory/CPU are used
Rate, I/O load etc.;
S2: whether the state that comprehensive judgement service server is carried out according to above-mentioned various performance parameters there is exception.
However, the data only obtained by service server this machine testing in above-mentioned detection method carry out sentencing for state
It is disconnected, without considering the network condition between client and service server, the state of service server is substantially reduced in this way
Judgment accuracy.
For above-mentioned problem, currently no effective solution has been proposed.
Summary of the invention
The embodiment of the invention provides a kind of server state detection method and devices, at least to solve in the prior art only
The technical problem of detection inaccuracy caused by state-detection is carried out based on server native.
According to an aspect of an embodiment of the present invention, provide a kind of server state detection method, comprising: generate with to
The corresponding test assignment of the configuration parameter of detection service device;Send above-mentioned test assignment to multiple detections visitor of distributed deployment
Family end;Receive the test knot that above-mentioned test assignment is executed to above-mentioned server to be detected that above-mentioned multiple detection clients return
Fruit;The state of above-mentioned server to be detected is judged according to the above-mentioned test result that above-mentioned multiple detection clients return.
According to another aspect of an embodiment of the present invention, a kind of server state detection device is additionally provided, comprising: generate single
Member, for generating test assignment corresponding with the configuration parameter of server to be detected;Transmission unit is used for above-mentioned test assignment
It is sent to multiple detection clients of distributed deployment;Receiving unit, pair returned for receiving above-mentioned multiple detection clients
Above-mentioned server to be detected executes the test result of above-mentioned test assignment;Judging unit, for according to above-mentioned multiple detection clients
The above-mentioned test result that end returns judges the state of above-mentioned server to be detected.
In embodiments of the present invention, by the way that test assignment corresponding with the configuration parameter of server to be detected to be issued to
Multiple detection clients of distributed deployment, the test result returned according to above-mentioned multiple detection clients are above-mentioned to be checked to judge
Whether the state for surveying server is in normally, carries out state-detection institute so as to avoid server native is based only upon in the prior art
The technical problem of caused detection inaccuracy, to realize to be detected from the angle recognition of the detection client of distributed deployment
The state of server improves the accuracy of state-detection.
In addition, being compared analysis using the test result returned based on history reference value to multiple detection clients
Mode, effectively detection, further increases the state-detection of server to be measured with realizing the state to above-mentioned server to be detected
Accuracy.
Detailed description of the invention
The drawings described herein are used to provide a further understanding of the present invention, constitutes part of this application, this hair
Bright illustrative embodiments and their description are used to explain the present invention, and are not constituted improper limitations of the present invention.In the accompanying drawings:
Fig. 1 is a kind of schematic diagram of optional server state detection system according to an embodiment of the present invention;
Fig. 2 is a kind of flow chart of optional server state detection method according to an embodiment of the present invention;
Fig. 3 is the flow chart of another optional server state detection method according to an embodiment of the present invention;
Fig. 4 is the flow chart of another optional server state detection method according to an embodiment of the present invention;
Fig. 5 is the flow chart of another optional server state detection method according to an embodiment of the present invention;
Fig. 6 is a kind of schematic diagram of optional server state detection device according to an embodiment of the present invention;And
Fig. 7 is a kind of schematic diagram of optional server state detection device according to an embodiment of the present invention.
Specific embodiment
In order to enable those skilled in the art to better understand the solution of the present invention, below in conjunction in the embodiment of the present invention
Attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is only
The embodiment of a part of the invention, instead of all the embodiments.Based on the embodiments of the present invention, ordinary skill people
The model that the present invention protects all should belong in member's every other embodiment obtained without making creative work
It encloses.
It should be noted that description and claims of this specification and term " first " in above-mentioned attached drawing, "
Two " etc. be to be used to distinguish similar objects, without being used to describe a particular order or precedence order.It should be understood that using in this way
Data be interchangeable under appropriate circumstances, so as to the embodiment of the present invention described herein can in addition to illustrating herein or
Sequence other than those of description is implemented.In addition, term " includes " and " having " and their any deformation, it is intended that cover
Cover it is non-exclusive include, for example, the process, method, system, product or equipment for containing a series of steps or units are not necessarily limited to
Step or unit those of is clearly listed, but may include be not clearly listed or for these process, methods, product
Or other step or units that equipment is intrinsic.
Embodiment 1
According to embodiments of the present invention, a kind of server state detection method is provided, the above method can be applied to such as Fig. 1
Shown in detection system, wherein above system can include but is not limited to: service server 102, detection client 104-1
To detection client 104-4, server state detecting and controlling system 106, wherein above-mentioned server state inspection in the present embodiment
Surveying control system 106 can include but is not limited to: data acquisition and procession module 108, analysis module 110, result output module
112, exploration policy management and configuration module 114, service basic information bank 116.Optionally, in the present embodiment, above-mentioned service
Modules in device state-detection control system 106 can integrate in a network equipment, can also be located in a distributed manner
In the different network equipments.
Optionally, in the present embodiment, above-mentioned detection client 104-1 extremely detection client 104-4 and service server
102 can be, but not limited to be deployed in different positions in a distributed manner.For example, detection client 104-1 is located at Beijing, client is detected
End 104-2 is located at Shanghai, and detection client 104-3 is located at Guangzhou, and detection client 104-3 is located at Chengdu, service server 102
Positioned at Dalian.Comprehensive state verification is carried out to service server by the detection client of multiple and different positions.
Further, the number of above-mentioned detection client and location are only an examples, and the present embodiment does not do this
It limits, it can be according to practically the location of the number of detection increase in demand detection client and/or adjustment detection client.
Optionally, in the present embodiment, as shown in Fig. 2, above-mentioned server state detection method may include:
S202 generates test assignment corresponding with the configuration parameter of server to be detected;
S204 sends test assignment to multiple detection clients of distributed deployment;
S206 receives the test result treated detection service device and execute test assignment that multiple detection clients return;
S208 judges the state of server to be detected according to the test result that multiple detection clients return.
Optionally, in the present embodiment, the configuration parameter of server to be detected can include but is not limited to it is following at least it
One: protocol type, open port, operating system, open service and system control strategy.
Optionally, in the present embodiment, test assignment corresponding with the configuration parameter of server to be detected can in advance about
It is fixed, for example, the content in agreement test data packet and test response data packet.
Optionally, in this embodiment, the test assignment for treating the generation of detection service device can be, but not limited to: based on different
Type of service generates different test assignments, the different characteristics based on server generate different test assignments.Wherein, above-mentioned industry
Service type can include but is not limited to: TCP/UDP server, WEB server, DNS server.Wherein, above-mentioned server
Characteristic can include but is not limited to: PING delay, port connected ratio, life span (TTL, Time To Live), HTTP are returned
Code.Optionally, in the present embodiment, the test assignment generated for server to be detected can be for testing above-mentioned clothes to be detected
Different characteristics of the business device when being directed to same task are also possible to for testing above-mentioned server to be detected for different task
When same characteristic.
For example, as shown in connection with fig. 1, detection client 104-1 had sent 1000 to service server 102 in 1 hour
The test data packet for requesting execution business (for example, TCP/UDP server), however, receiving only 850 from service server 102
A test response data packet.That is, detection client 104-1 is to the connected ratio of 102 requested service of service server
85%.Similarly, can obtain detection client 104-2 to the connected ratio of 102 requested service of service server is 80%, and detection is objective
Family end 104-3 is 90% to the connected ratio of 102 requested service of service server, detects client 104-4 to service server 102
The connected ratio of requested service is 75%, as shown in table 1.
In another example for example, as shown in connection with fig. 1, detection client 104-1 sends requested service (example to service server 102
Such as, TCP/UDP server) time of test data packet be 10:00, and receive the test sent by service server 102
After the time of response data packet is 10ms, that is, the request delay that detection client 104-1 is detected is 10ms.Similarly, it can obtain
It is 8ms that client 104-2, which must be detected, to the delay of 102 requested service of service server, detects client 104-3 to business service
The delay of 102 requested service of device be 6ms, detection client 104-4 to the delay of 102 requested service of service server be 12ms,
As shown in table 1.
Table 1
Detect client |
Connected ratio |
It is delayed (unit: ms) |
Detect client 104-1 |
85% |
10 |
Detect client 104-2 |
80% |
8 |
Detect client 104-3 |
90% |
6 |
Detect client 104-4 |
75% |
12 |
Optionally, in the present embodiment, it can include but is not limited to for detecting the measuring technology of server to be detected:
TCP detection, UDP detection, IMCP detection.
Optionally, in the present embodiment, above-mentioned test assignment is sent to multiple detection clients 104 of distributed deployment
In mode can include but is not limited to: transmitted in parallel.For example, as shown in Figure 1, establish detection client 104-1 be used for to
Detection service device (for example, service server 102) sends the multiple processes or thread of test data packet, then detection visitor may be implemented
Family end 104-1 concurrently sends multiple test data packets to service server 102, improves the detection speed of server state detection
Degree.
Optionally, the test result returned in the present embodiment according to above-mentioned multiple detection clients, judges above-mentioned to be checked
The mode for surveying the state of server can include but is not limited to: the result parameter in test result is compared with history reference value
Compared with, by judging whether difference between the two is greater than predetermined threshold, judge above-mentioned server to be detected whether in normal
State.
Optionally, in the present embodiment, by according to the real-time change of server to be detected, real-time update has been saved above-mentioned
The configuration parameter of server to be detected.
Optionally, in the present embodiment, server state detection system as shown in connection with fig. 1, above-mentioned detection method are held
Row process can be as shown in Figure 3:
S302, exploration policy management and configuration module 114 obtained from business information base 116 server to be detected (for example,
Service server 102) relevant information (for example, configuration parameter, including but not limited to protocol type, open port, operation system
System, open service and system control strategy);
S304, exploration policy management and configuration module 114 are by generation with server to be detected (for example, service server
102) the corresponding test assignment of configuration parameter, and it is issued to multiple detection clients 104 of distributed deployment;
S306, server to be detected execute test assignment, and by 108 collecting test data of data acquisition and procession module;
Test data after multiple detection complete test assignments of client executing is back to analysis module 110 by S308;
Test after analysis is recorded a demerit and feeds back to exploration policy management and configuration module 114 by S310, judges service to be detected
Whether the state of device is normal.
S312 is updated the data in business information base 116.It is alternatively possible to update industry according to the result of feedback
The information corresponding with server to be detected recorded in business information bank, for example, the status information of service server 102.
The embodiment provided through the invention, by by test assignment corresponding with the configuration parameter of server to be detected
Multiple detection clients of distributed deployment are issued to, carry out comprehensive point by the test result that above-mentioned multiple detection clients return
Analysis, to judge whether the state of above-mentioned server to be detected is in normally, so as to avoid in the prior art only from server sheet
Machine carries out the problem of detection inaccuracy caused by state-detection, to be checked from the angle recognition of the detection client of distributed deployment
The state for surveying server, improves the accuracy of state-detection.
As a kind of optional scheme, step S208 judges to be checked according to the test result that multiple detection clients return
Survey server state include:
S1, judges whether the difference between result parameter and corresponding history reference value in test result is greater than predetermined threshold
Value, wherein history reference value is the multiple first obtained first test knot of test assignment treating detection service device and having executed
What fruit was counted;
S2 judges that server to be detected is in abnormality if difference is greater than predetermined threshold;Otherwise, judge to
Detection service device is in normal condition.
Optionally, in the present embodiment, obtained history reference value can be after the first test assignment statistics executed
But it is not limited to: the desired value of the multiple formerly average value of test result, repeatedly first test result.Optionally, in the present embodiment
In, the test parameter in test result can be but be not limited to: the average value of multiple detection client test results, multiple detections
The desired value of client test result.
Optionally, in the present embodiment, with the result parameter in test result and the difference between corresponding history reference value
The predetermined threshold that value compares can be pre-configured with identical or different value under different application scenarios, and the present embodiment is to this
Any restriction is not done.
For example, as shown in connection with fig. 1, detecting client and having sent request execution business to service server 102 in 1 hour
The test data packet of (for example, TCP/UDP server), it is assumed that the history reference value of the connected ratio of service server 102 is
80%, and the test result returned through multiple detection clients is it is found that detection client 104-1 is requested to service server 102
The connected ratio of business is 85%, and detection client 104-2 is 80% to the connected ratio of 102 requested service of service server, is detected
Client 104-3 is 90% to the connected ratio of 102 requested service of service server, detects client 104-4 to service server
The connected ratio of 102 requested services is 75%.Assuming that using the average value of the test result of multiple detection clients as final test
As a result, then above-mentioned is 82.5% about the connected ratio of business TCP/UDP server for service server 102.
Further, judge the test parameter connected ratio in the final testing result obtained by above-mentioned multiple detection clients
Difference between (for example, connected ratio is 82.5%) and history reference value (for example, history reference value is 80%) is 2.5%, false
If the predetermined threshold set in the present embodiment as 2%, then may determine that above-mentioned difference is greater than predetermined threshold 2%, then judge
Above-mentioned service server is in abnormality.
The embodiment provided through the invention, by result parameter and the corresponding history reference value in test result it
Between difference judged, test result is analyzed with realizing based on history reference value, so reach judge it is to be detected
The whether normal purpose of the state of server, effectively detection, further mentions with realizing the state to above-mentioned server to be detected
The accuracy of the state-detection of high server to be measured.
As a kind of optional scheme, as shown in figure 4, generating the configuration parameter with server to be detected in step S202
Before corresponding test assignment, further includes:
S402 treats detection service device and executes repeatedly first test assignment, obtains first test result;
S404 counts first test result and obtains history reference value corresponding from different result parameters.
Illustrate below in conjunction with specific example, as shown in connection with fig. 1, in the present embodiment, above-mentioned test assignment is for detecting visitor
The connected ratio of execution business (for example, TCP/UDP server) is requested to service server 102 in family end.Further, above-mentioned detection
Client 104-1 is to detection client 104-4 in 10:00-11:00,12:00-13:00,14:00-15:00 to service server
102 perform first test assignment three times, and obtain each test result of each detection client as shown in Table 2 (for example,
Connected ratio) and the resulting multiple average values for detecting the connected ratio that clients are tested every time of calculating.
Table 2
As shown in table 2, the history reference value of the connected ratio obtained by the first test result of above-mentioned statistics can be, but not limited to
For the average value of the above-mentioned multiple test result of detection client, wherein each test result of above-mentioned detection client can with but
It is not limited to the average value of the test result of multiple detection clients.For example, it is inspection that statistics tests obtained connected ratio for the first time
Survey the average value 85% of the test result of client 104-1 to detection client 104-4, further, what second of test obtained
Connected ratio is 82.5%, and testing obtained connected ratio for the third time is 83.75%, then service server 102 is about business TCP/UDP
The history reference value of the connected ratio of server is (85%+82.5%+83.75%)/3=83.75%.
The embodiment provided through the invention, by establishing history reference value, so that server state detection can be based on
History reference value is analyzed, and effectively detection, further increases clothes to be measured with realizing the state to above-mentioned server to be detected
The accuracy of the state-detection of business device.
As a kind of optional scheme, as shown in figure 5, in the multiple detections visitor for sending test assignment to distributed deployment
After the end of family, and receive it is multiple detection clients return treat detection service device execute test assignment test results it
Before, each of multiple detection clients (for example, detection client 104-1) will all execute following operation:
S502 generates test data packet corresponding with test assignment;
Test data packet is sent to server to be detected (for example, service server 102) by S504;
S506 receives the test result response message in response to test data packet that server to be detected returns;
S508 generates test result according to test result response message.
Optionally, each detection visitor being applied in the present embodiment in multiple detection clients of server state detection
Family end can all feed back the test result received by server to be detected.
Optionally, in the present embodiment, to the test result of each detection client feedback in multiple detection clients
It is counted, optionally, in the present embodiment, the mode of statistics may include but be not limited to: calculating the survey of multiple detection clients
The desired value of test result, the average value for calculating multiple detection client test results.
Illustrate below in conjunction with specific example, in conjunction with shown in first row in Fig. 1 and table 2, in the present embodiment, above-mentioned test
Task is for detecting the connected ratio that client requests execution business (for example, TCP/UDP server) to service server 102.It is more
Each of a detection client (for example, detection client 104-1) will all generate the test assignment pair tested with connected ratio
The test data packet answered, and above-mentioned test data packet is sent to service server 102, then, above-mentioned detection client will connect
The test result response message in response to test data packet of the return of service server 102 is received, for example, detection client 104-
1 receive with the connected ratio of service server 102 be 85%, detection client 104-3 receive the company with service server 102
Passband is 80%, and it is 90% that detection client 104-3, which is received with the connected ratio of service server 102, detects client 104-4
Receiving with the connected ratio of service server 102 is 85%.Finally, above-mentioned detection client will be obtained according to multiple detection clients
The test result response message arrived generates test result as shown in Table 2, for example, the connected ratio of multiple detection clients is averaged
Value is 85%.
The embodiment provided through the invention, by carrying out treating detection service based on multiple detection clients in network
The state-detection of device avoids and is based only upon detection inaccuracy caused by server native progress state-detection in the prior art
Problem improves to realize the state of the angle recognition server to be detected by the detection client from distributed deployment
The accuracy of state-detection.
As a kind of optional scheme, test data packet is sent to server to be detected and includes: by multiple detection clients
Test data packet is concurrently sent to server to be detected by S1, multiple detection clients.
Optionally, in the present embodiment, each of multiple detection clients detection client can be, but not limited to
Establish multiple processes or thread.For example, as shown in connection with fig. 1, detection client 104-1 can be sent out parallel to service server 102
Multiple test data packets are sent, while testing multiple characteristics of the service server 102 about some business, alternatively, testing simultaneously more
Some characteristic of multiple business in a service server.
The embodiment provided through the invention, multiple detection clients by way of transmitted in parallel test data packet, into
And realize the detection speed for improving the state-detection for treating detection service device.
As a kind of optional scheme, multiple detection clients by test data packet be sent to server to be detected it
Afterwards, further includes:
S1, if judging, server to be detected is in abnormality, and protection configuration parameter is arranged, wherein protection configuration
Parameter is used to filter out the data packet that part is sent to server to be detected.
Optionally, protection configuration parameter in the present embodiment can be, but not limited to include: data transmitted by client
Quantity, the quantity of service server received data packet of packet.Optionally, in the present embodiment, filtration fraction be sent to
The mode of the data packet of detection service device can include but is not limited to: limitation given client end number transmitted within the unit time
According to the quantity of packet in predetermined threshold range, the IP address at shielding given client end, limitation server to be detected be in the unit time
The quantity of interior received data packet.
For example, as shown in connection with fig. 1, when judging that server to be detected (for example, service server 102) be in abnormal shape
State modifies the protection configuration parameter that above-mentioned service server 102 is arranged then to realize that filtering out part is sent to service server
102 data packet.Wherein, the mode for filtering data packet can be such that
1) assume that the quantity of detection client 104-1 data packet transmitted within the unit time is excessive (for example, 5000
A/hour), then it can limit the quantity for the data packet that detection client 104-1 is sent within the unit time less than 1000, then
Data packet greater than 1000 will be all filtered.
2) assume that the quantity of detection client 104-1 data packet transmitted within the unit time is excessive (for example, 5000
A/hour), then the IP address of above-mentioned detection client 104-1 can be directly shielded, and then realize and filter out detection client
Entire packet transmitted by 104-1.
3) assume that the quantity of the data packet received within the unit time of service server 102 is excessive (for example, 8000
A/hour), then it can limit the quantity of data packet that detection client 104-1 is sent within the unit time less than 5000, example
Such as, by the data packet sent into row stochastic discarding, large number of data packet is filtered out to realize.
The embodiment provided through the invention, the protection configuration parameter of the server to be detected by the way that abnormality will be in
It is configured, so that above-mentioned server to be detected is maintained at healthier operating status.
It should be noted that for the various method embodiments described above, for simple description, therefore, it is stated as a series of
Combination of actions, but those skilled in the art should understand that, the present invention is not limited by the sequence of acts described because
According to the present invention, some steps may be performed in other sequences or simultaneously.Secondly, those skilled in the art should also know
It knows, the embodiments described in the specification are all preferred embodiments, and related actions and modules is not necessarily of the invention
It is necessary.
Through the above description of the embodiments, those skilled in the art can be understood that according to above-mentioned implementation
The method of example can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but it is very much
In the case of the former be more preferably embodiment.Based on this understanding, technical solution of the present invention is substantially in other words to existing
The part that technology contributes can be embodied in the form of software products, which is stored in a storage
In medium (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that a terminal device (can be mobile phone, calculate
Machine, server or network equipment etc.) execute method described in each embodiment of the present invention.
Embodiment 2
According to embodiments of the present invention, additionally provide it is a kind of for implementing the server state detection device of the above method, on
Stating device can be applied in detection system as shown in Figure 1, wherein above system can include but is not limited to: business service
Device 102, detection client 104-1 to detection client 104-4, server state detecting and controlling system 106, wherein in this reality
Applying above-mentioned server state detecting and controlling system 106 in example can include but is not limited to: data acquisition and procession module 108 is divided
Analyse module 110, result output module 112, exploration policy management and configuration module 114, service basic information bank 116.Optionally,
In the present embodiment, the modules in above-mentioned server state detecting and controlling system 106 can integrate in a network equipment
In, it can also be located in the different network equipments in a distributed manner.
Optionally, in the present embodiment, above-mentioned detection client 104-1 extremely detection client 104-4 and service server
102 can be, but not limited to be deployed in different positions in a distributed manner.For example, detection client 104-1 is located at Beijing, client is detected
End 104-2 is located at Shanghai, and detection client 104-3 is located at Guangzhou, and detection client 104-3 is located at Chengdu, service server 102
Positioned at Dalian.Comprehensive state verification is carried out to service server by the detection client of multiple and different positions.
Further, the number of above-mentioned detection client and location are only an examples, and the present embodiment does not do this
It limits, it can be according to practically the location of the number of detection increase in demand detection client and/or adjustment detection client.
Optionally, in the present embodiment, as shown in fig. 6, the device includes: in the present embodiment
1) generation unit 602, for generating test assignment corresponding with the configuration parameter of server to be detected;
2) transmission unit 604, for sending test assignment to multiple detection clients of distributed deployment;
3) receiving unit 606 execute test assignment for receiving the detection service device for the treatment of that multiple detection clients return
Test result;
4) judging unit 608, the test result for being returned according to multiple detection clients judge server to be detected
State.
Optionally, in the present embodiment, the configuration parameter of server to be detected can include but is not limited to it is following at least it
One: protocol type, open port, operating system, open service and system control strategy.
Optionally, in the present embodiment, test assignment corresponding with the configuration parameter of server to be detected can in advance about
It is fixed, for example, the content in agreement test data packet and test response data packet.
Optionally, in this embodiment, the test assignment for treating the generation of detection service device can be, but not limited to: based on different
Type of service generates different test assignments, the different characteristics based on server generate different test assignments.Wherein, above-mentioned industry
Service type can include but is not limited to: TCP/UDP server, WEB server, DNS server.Wherein, above-mentioned server
Characteristic can include but is not limited to: PING delay, port connected ratio, life span (TTL, Time To Live), HTTP are returned
Code.Optionally, in the present embodiment, the test assignment generated for server to be detected can be for testing above-mentioned clothes to be detected
Different characteristics of the business device when being directed to same task are also possible to for testing above-mentioned server to be detected for different task
When same characteristic.
For example, as shown in connection with fig. 1, detection client 104-1 had sent 1000 to service server 102 in 1 hour
The test data packet for requesting execution business (for example, TCP/UDP server), however, receiving only 850 from service server 102
A test response data packet.That is, detection client 104-1 is to the connected ratio of 102 requested service of service server
85%.Similarly, can obtain detection client 104-2 to the connected ratio of 102 requested service of service server is 80%, and detection is objective
Family end 104-3 is 90% to the connected ratio of 102 requested service of service server, detects client 104-4 to service server 102
The connected ratio of requested service is 75%, as shown in table 3.
In another example for example, as shown in connection with fig. 1, detection client 104-1 sends requested service (example to service server 102
Such as, TCP/UDP server) time of test data packet be 10:00, and receive the test sent by service server 102
After the time of response data packet is 10ms, that is, the request delay that detection client 104-1 is detected is 10ms.It similarly, can be with
It is 8ms that detection client 104-2, which is obtained, to the delay of 102 requested service of service server, and detection client 104-3 takes to business
The delay of business 102 requested service of device is 6ms, detects client 104-4 to the delay of 102 requested service of service server and is
12ms, as shown in table 3.
Table 3
Detect client |
Connected ratio |
It is delayed (unit: ms) |
Detect client 104-1 |
85% |
10 |
Detect client 104-2 |
80% |
8 |
Detect client 104-3 |
90% |
6 |
Detect client 104-4 |
75% |
12 |
Optionally, in the present embodiment, it can include but is not limited to for detecting the measuring technology of server to be detected:
TCP detection, UDP detection, IMCP detection.
Optionally, in the present embodiment, above-mentioned test assignment is sent to multiple detection clients 104 of distributed deployment
In mode can include but is not limited to: transmitted in parallel.For example, as shown in Figure 1, establish detection client 104-1 be used for to
Detection service device (for example, service server 102) sends the multiple processes or thread of test data packet, then detection visitor may be implemented
Family end 104-1 concurrently sends multiple test data packets to service server 102, improves the detection speed of server state detection
Degree.
Optionally, the test result returned in the present embodiment according to above-mentioned multiple detection clients, judges above-mentioned to be checked
The mode for surveying the state of server can include but is not limited to: the result parameter in test result is compared with history reference value
Compared with, by judging whether difference between the two is greater than predetermined threshold, judge above-mentioned server to be detected whether in normal
State.
Optionally, in the present embodiment, by according to the real-time change of server to be detected, real-time update has been saved above-mentioned
The configuration parameter of server to be detected.
The embodiment provided through the invention, by by test assignment corresponding with the configuration parameter of server to be detected
Multiple detection clients of distributed deployment are issued to, carry out comprehensive point by the test result that above-mentioned multiple detection clients return
Analysis, to judge whether the state of above-mentioned server to be detected is in normally, so as to avoid in the prior art only from business service
Device the machine carries out the problem of detection inaccuracy caused by state-detection, from the angle recognition of the detection client of distributed deployment
The state of server to be detected improves the accuracy of state-detection.
As a kind of optional scheme, judging unit 608 includes:
1) judgment module, for judging that the difference between the result parameter in test result and corresponding history reference value is
It is no to be greater than predetermined threshold, wherein history reference value is obtained by treating the multiple first test assignment that detection service device has executed
First test result counted;If difference is greater than predetermined threshold, judge that server to be detected is in abnormal
State;Otherwise, judge that server to be detected is in normal condition.
Optionally, in the present embodiment, obtained history reference value can be after the first test assignment statistics executed
But it is not limited to: the desired value of the multiple formerly average value of test result, repeatedly first test result.Optionally, in the present embodiment
In, the test parameter in test result can be but be not limited to: the average value of multiple detection client test results, multiple detections
The desired value of client test result.
Optionally, in the present embodiment, with the result parameter in test result and the difference between corresponding history reference value
The predetermined threshold that value compares can be pre-configured with identical or different value under different application scenarios, and the present embodiment is to this
Any restriction is not done.
For example, as shown in connection with fig. 1, detecting client and having sent request execution business to service server 102 in 1 hour
The test data packet of (for example, TCP/UDP server), it is assumed that the history reference value of the connected ratio of service server 102 is
80%, and the test result returned through multiple detection clients is it is found that detection client 104-1 is requested to service server 102
The connected ratio of business is 85%, and detection client 104-2 is 80% to the connected ratio of 102 requested service of service server, is detected
Client 104-3 is 90% to the connected ratio of 102 requested service of service server, detects client 104-4 to service server
The connected ratio of 102 requested services is 75%.Assuming that using the average value of the test result of multiple detection clients as final test
As a result, then above-mentioned is 82.5% about the connected ratio of business TCP/UDP server for service server 102.
Further, judge the test parameter connected ratio in the final testing result obtained by above-mentioned multiple detection clients
Difference between (for example, connected ratio is 82.5%) and history reference value (for example, history reference value is 80%) is 2.5%, false
If the predetermined threshold set in the present embodiment as 2%, then may determine that above-mentioned difference is greater than predetermined threshold 2%, then judge
Above-mentioned service server is in abnormality.
The embodiment provided through the invention, by result parameter and the corresponding history reference value in test result it
Between difference judged, with realize be based on history reference value, test result is analyzed, so reach judge it is to be detected
The whether normal purpose of the state of server, effectively detection, further mentions with realizing the state to above-mentioned server to be detected
The accuracy of the state-detection of high server to be measured.
As a kind of optional scheme, as shown in fig. 7, the device in the present embodiment further include:
1) test cell 702, for generating the test times corresponding with the configuration parameter of the server to be detected
Before business, the repeatedly first test assignment is executed to the server to be detected, obtains the first test result;
2) statistic unit 704, for count the first test result obtain it is corresponding from different result parameters described
History reference value.
Illustrate below in conjunction with specific example, as shown in connection with fig. 1, in the present embodiment, above-mentioned test assignment is for detecting visitor
The connected ratio of execution business (for example, TCP/UDP server) is requested to service server 102 in family end.Further, above-mentioned detection
Client 104-1 is to detection client 104-4 in 10:00-11:00,12:00-13:00,14:00-15:00 to service server
102 perform first test assignment three times, and obtain each test result of each detection client as shown in table 4 (for example,
Connected ratio) and the resulting multiple average values for detecting the connected ratio that clients are tested every time of calculating.
Table 4
As shown in table 4, the history reference value of the connected ratio obtained by the first test result of above-mentioned statistics can be, but not limited to
For the average value of the above-mentioned multiple test result of detection client, wherein each test result of above-mentioned detection client can with but
It is not limited to the average value of the test result of multiple detection clients.For example, it is inspection that statistics tests obtained connected ratio for the first time
Survey the average value 85% of the test result of client 104-1 to detection client 104-4, further, what second of test obtained
Connected ratio is 82.5%, and testing obtained connected ratio for the third time is 83.75%, then service server 102 is about business TCP/UDP
The history reference value of the connected ratio of server is (85%+82.5%+83.75%)/3=83.75%.
The embodiment provided through the invention, by establishing history reference value, so that server state detection can be based on
History reference value is analyzed, and effectively detection, further increases clothes to be measured with realizing the state to above-mentioned server to be detected
The accuracy of the state-detection of business device.
As a kind of optional scheme, each of above-mentioned multiple detection clients detect client, comprising:
1) the first generation unit, for generating test data packet corresponding with test assignment;
2) transmission unit, for test data packet to be sent to server to be detected (for example, service server 102);
3) receiving unit is responded for receiving the test result in response to test data packet that server to be detected returns
Information;
4) the second generation unit, for generating test result according to test result response message.
Optionally, each detection visitor being applied in the present embodiment in multiple detection clients of server state detection
Family end can all feed back the test result received by server to be detected.
Optionally, in the present embodiment, to the test result of each detection client feedback in multiple detection clients
It is counted, optionally, in the present embodiment, the mode of statistics may include but be not limited to: calculating the survey of multiple detection clients
The desired value of test result, the average value for calculating multiple detection client test results.
Illustrate below in conjunction with specific example, in conjunction with shown in first row in Fig. 1 and table 4, in the present embodiment, above-mentioned test
Task is for detecting the connected ratio that client requests execution business (for example, TCP/UDP server) to service server 102.It is more
Each of a detection client (for example, detection client 104-1) will all generate the test assignment pair tested with connected ratio
The test data packet answered, and above-mentioned test data packet is sent to service server 102, then, above-mentioned detection client will connect
The test result response message in response to test data packet of the return of service server 102 is received, for example, detection client 104-
1 receive with the connected ratio of service server 102 be 85%, detection client 104-3 receive the company with service server 102
Passband is 80%, and it is 90% that detection client 104-3, which is received with the connected ratio of service server 102, detects client 104-4
Receiving with the connected ratio of service server 102 is 85%.Finally, above-mentioned detection client will be obtained according to multiple detection clients
To test result response message generate test result as shown in table 4, for example, the connected ratio of multiple detection clients is averaged
Value is 85%.
The embodiment provided through the invention, by carrying out treating detection service based on multiple detection clients in network
The state-detection of device avoids and is based only upon detection inaccuracy caused by server native progress state-detection in the prior art
Problem improves to realize the state of the angle recognition server to be detected by the detection client from distributed deployment
The accuracy of state-detection.
As a kind of optional scheme, the transmission unit includes:
1) sending module, for test data packet to be concurrently sent to server to be detected.
Optionally, in the present embodiment, each of multiple detection clients detection client can be, but not limited to
Establish multiple processes or thread.For example, as shown in connection with fig. 1, detection client 104-1 can be sent out parallel to service server 102
Multiple test data packets are sent, while testing multiple characteristics of the service server 102 about some business, alternatively, testing simultaneously more
Some characteristic of multiple business in a service server.
The embodiment provided through the invention, multiple detection clients by way of transmitted in parallel test data packet, into
And realize the detection speed for improving the state-detection for treating detection service device.
As a kind of optional scheme, as shown in fig. 7, the device in the present embodiment further include:
1) filter element 706, it is described to be checked for being sent to the test data packet in the multiple detection client
It surveys after server, when judging that the server to be detected is when in an abnormal state, then protection configuration parameter is set, wherein
The protection configuration parameter is used to filter out the data packet that part is sent to the server to be detected.
Optionally, protection configuration parameter in the present embodiment can be, but not limited to include: data transmitted by client
Quantity, the quantity of service server received data packet of packet.Optionally, in the present embodiment, filtration fraction be sent to
The mode of the data packet of detection service device can include but is not limited to: limitation given client end number transmitted within the unit time
According to the quantity of packet in predetermined threshold range, the IP address at shielding given client end, limitation server to be detected be in the unit time
The quantity of interior received data packet.
For example, as shown in connection with fig. 1, when judging that server to be detected (for example, service server 102) be in abnormal shape
State modifies the protection configuration parameter that above-mentioned service server 102 is arranged then to realize that filtering out part is sent to service server
102 data packet.Wherein, the mode for filtering data packet can be such that
1) assume that the quantity of detection client 104-1 data packet transmitted within the unit time is excessive (for example, 5000
A/hour), then it can limit the quantity for the data packet that detection client 104-1 is sent within the unit time less than 1000, then
Data packet greater than 1000 will be all filtered.
2) assume that the quantity of detection client 104-1 data packet transmitted within the unit time is excessive (for example, 5000
A/hour), then the IP address of above-mentioned detection client 104-1 can be directly shielded, and then realize and filter out detection client
Entire packet transmitted by 104-1.
3) assume that the quantity of the data packet received within the unit time of service server 102 is excessive (for example, 8000
A/hour), then it can limit the quantity of data packet that detection client 104-1 is sent within the unit time less than 5000, example
Such as, by the data packet sent into row stochastic discarding, large number of data packet is filtered out to realize.
The embodiment provided through the invention, the protection configuration parameter of the server to be detected by the way that abnormality will be in
It is configured, so that above-mentioned server to be detected is maintained at healthier operating status.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
In the above embodiment of the invention, it all emphasizes particularly on different fields to the description of each embodiment, does not have in some embodiment
The part of detailed description, reference can be made to the related descriptions of other embodiments.
In several embodiments provided herein, it should be understood that disclosed client, it can be by others side
Formula is realized.Wherein, the apparatus embodiments described above are merely exemplary, such as the division of the unit, and only one
Kind of logical function partition, there may be another division manner in actual implementation, for example, multiple units or components can combine or
It is desirably integrated into another system, or some features can be ignored or not executed.Another point, it is shown or discussed it is mutual it
Between coupling, direct-coupling or communication connection can be through some interfaces, the INDIRECT COUPLING or communication link of unit or module
It connects, can be electrical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit
The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple
In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme
's.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unit
It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list
Member both can take the form of hardware realization, can also realize in the form of software functional units.
If the integrated unit is realized in the form of SFU software functional unit and sells or use as independent product
When, it can store in a computer readable storage medium.Based on this understanding, technical solution of the present invention is substantially
The all or part of the part that contributes to existing technology or the technical solution can be in the form of software products in other words
It embodies, which is stored in a storage medium, including some instructions are used so that a computer
Equipment (can for personal computer, server or network equipment etc.) execute each embodiment the method for the present invention whole or
Part steps.And storage medium above-mentioned includes: that USB flash disk, read-only memory (ROM, Read-Only Memory), arbitrary access are deposited
Reservoir (RAM, Random Access Memory), mobile hard disk, magnetic or disk etc. be various to can store program code
Medium.
The above is only a preferred embodiment of the present invention, it is noted that for the ordinary skill people of the art
For member, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications are also answered
It is considered as protection scope of the present invention.