CN104967540B - Server state detection method and device - Google Patents

Server state detection method and device Download PDF

Info

Publication number
CN104967540B
CN104967540B CN201410256635.8A CN201410256635A CN104967540B CN 104967540 B CN104967540 B CN 104967540B CN 201410256635 A CN201410256635 A CN 201410256635A CN 104967540 B CN104967540 B CN 104967540B
Authority
CN
China
Prior art keywords
server
detected
test
detection
client
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
CN201410256635.8A
Other languages
Chinese (zh)
Other versions
CN104967540A (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.)
Tencent Technology Shenzhen Co Ltd
Tencent Cloud Computing Beijing Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201410256635.8A priority Critical patent/CN104967540B/en
Publication of CN104967540A publication Critical patent/CN104967540A/en
Application granted granted Critical
Publication of CN104967540B publication Critical patent/CN104967540B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Computer And Data Communications (AREA)
  • Debugging And Monitoring (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a kind of server state detection method and devices, wherein this method comprises: generating test assignment corresponding with the configuration parameter of server to be detected;Send test assignment to multiple detection clients of distributed deployment;Receive the test result treated detection service device and execute test assignment that multiple detection clients return;The state of server to be detected is judged according to the test result that multiple detection clients return.The present invention solves and is based only upon the technical problem that server native carries out detection inaccuracy caused by state-detection in the prior art.

Description

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.

Claims (8)

1. a kind of server state detection method characterized by comprising
Generate test assignment corresponding with the configuration parameter of server to be detected;
The test assignment is sent to multiple detection clients of distributed deployment, so that the multiple detection client generates Test data packet corresponding with the test assignment, and the test data packet is sent to the server to be detected;
Receive the test result that the multiple detection client is generated according to test result response message, wherein the survey Test result response message is the response message in response to the test data packet that the server to be detected returns;
Judge whether the difference between result parameter and corresponding history reference value in the test result is greater than predetermined threshold, Wherein, the history reference value is the multiple first obtained first survey of test assignment executed to the server to be detected What test result was counted;
If the difference is greater than the predetermined threshold, judge that the server to be detected is in abnormality, otherwise, judgement The server to be detected is in normal condition out.
2. the method according to claim 1, wherein generating the configuration parameter pair with the server to be detected Before the test assignment answered, further includes:
The repeatedly first test assignment is executed to the server to be detected, obtains the first test result;
It counts the first test result and obtains the history reference value corresponding from different result parameters.
3. the method according to claim 1, wherein the result parameter includes at least one of: PING prolongs Slow time, port connected ratio, life span TTL, HTTP return code.
4. the method according to claim 1, wherein the multiple detection client sends out the test data packet Giving the server to be detected includes:
The test data packet is concurrently sent to the server to be detected by the multiple detection client.
5. method according to claim 1 to 4, which is characterized in that according to the multiple detection client The test result returned judges after the state of the server to be detected, further includes:
If judging, the server to be detected is in abnormality, and protection configuration parameter is arranged, wherein the protection configuration Parameter is used to filter out the data packet that part is sent to the server to be detected.
6. a kind of server state detection device characterized by comprising
Generation unit, for generating test assignment corresponding with the configuration parameter of server to be detected;
Transmission unit, for sending the test assignment to multiple detection clients of distributed deployment, so that the multiple It detects client and generates corresponding with test assignment test data packet, and the test data packet is sent to described to be checked Survey server;
Receiving unit, the test knot generated for receiving the multiple detection client according to test result response message Fruit, wherein the test result response message is the sound in response to the test data packet that the server to be detected returns Answer information;
Judging unit, the test result for being returned according to the multiple detection client judge the server to be detected State;
Wherein, the judging unit includes: judgment module, for judging that the result parameter in the test result is gone through with corresponding Whether the difference between history reference value is greater than predetermined threshold, wherein the history reference value be to the server to be detected What the multiple first obtained first test result of test assignment executed was counted;If the difference is greater than described pre- Determine threshold value, then judges that the server to be detected is in abnormality;Otherwise, judge that the server to be detected is in just Normal state.
7. device according to claim 6, which is characterized in that further include:
Test cell, it is right for before generating corresponding with the configuration parameter of the server to be detected test assignment The server to be detected executes the repeatedly first test assignment, obtains the first test result;
Statistic unit obtains the history reference corresponding from different result parameters for counting the first test result Value.
8. device according to claim 6 or 7, which is characterized in that further include:
Filter element, for judging that the server to be detected is when in an abnormal state when the judging unit, setting protection Configuration parameter, wherein the protection configuration parameter is used to filter out the data packet that part is sent to the server to be detected.
CN201410256635.8A 2014-06-10 2014-06-10 Server state detection method and device Active CN104967540B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410256635.8A CN104967540B (en) 2014-06-10 2014-06-10 Server state detection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410256635.8A CN104967540B (en) 2014-06-10 2014-06-10 Server state detection method and device

Publications (2)

Publication Number Publication Date
CN104967540A CN104967540A (en) 2015-10-07
CN104967540B true CN104967540B (en) 2019-02-26

Family

ID=54221488

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410256635.8A Active CN104967540B (en) 2014-06-10 2014-06-10 Server state detection method and device

Country Status (1)

Country Link
CN (1) CN104967540B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107231268B (en) * 2016-03-25 2020-05-01 北京京东尚科信息技术有限公司 Method and device for testing website performance
CN106027329A (en) * 2016-05-16 2016-10-12 乐视控股(北京)有限公司 Push service testing method and device
CN106055429B (en) * 2016-05-24 2019-05-24 努比亚技术有限公司 A kind of information processing method and device
CN105847090B (en) * 2016-05-25 2019-07-02 青岛海信传媒网络技术有限公司 A kind of service testing method and detection terminal
CN107870830B (en) * 2016-09-23 2021-07-20 北京京东尚科信息技术有限公司 Method and device for improving availability of database
CN110300034B (en) * 2019-05-07 2021-01-29 清华大学 Web-based network speed measuring method and device
CN110138783A (en) * 2019-05-15 2019-08-16 重庆八戒电子商务有限公司 A method of ddos attack is handled based on cloud computing platform

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101141329A (en) * 2007-10-22 2008-03-12 中兴通讯股份有限公司 Method and system for implementing connectivity detection
CN101521604A (en) * 2009-04-03 2009-09-02 南京邮电大学 Strategy-based distributed performance monitoring method
CN103095683A (en) * 2012-12-13 2013-05-08 北京奇虎科技有限公司 Linux virtual server scheduling system and method
CN103220161A (en) * 2012-01-18 2013-07-24 深圳市腾讯计算机系统有限公司 Method and device for detecting server status
CN103391303A (en) * 2012-05-09 2013-11-13 腾讯科技(深圳)有限公司 Service fault noticing method and server using same

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8359493B2 (en) * 2010-07-29 2013-01-22 Computer Associates Think, Inc. Mechanism to provide assured recovery for distributed application
CN102223653A (en) * 2011-06-15 2011-10-19 中兴通讯股份有限公司 Method and system for testing telephone traffic performance of operation maintenance center (OMC)
CN103139007A (en) * 2011-12-05 2013-06-05 阿里巴巴集团控股有限公司 Method and system for detecting application server performance
CN103780445B (en) * 2012-10-22 2017-10-27 北京临近空间飞行器系统工程研究所 A kind of network flow monitoring system and method for threshold adaptive amendment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101141329A (en) * 2007-10-22 2008-03-12 中兴通讯股份有限公司 Method and system for implementing connectivity detection
CN101521604A (en) * 2009-04-03 2009-09-02 南京邮电大学 Strategy-based distributed performance monitoring method
CN103220161A (en) * 2012-01-18 2013-07-24 深圳市腾讯计算机系统有限公司 Method and device for detecting server status
CN103391303A (en) * 2012-05-09 2013-11-13 腾讯科技(深圳)有限公司 Service fault noticing method and server using same
CN103095683A (en) * 2012-12-13 2013-05-08 北京奇虎科技有限公司 Linux virtual server scheduling system and method

Also Published As

Publication number Publication date
CN104967540A (en) 2015-10-07

Similar Documents

Publication Publication Date Title
CN104967540B (en) Server state detection method and device
CN109962790B (en) Network quality monitoring method and device, electronic equipment and storage medium
US8125895B2 (en) Network looping detecting apparatus
CN106357622B (en) Exception flow of network based on software defined network detects system of defense
CN104717107B (en) The method, apparatus and system of network equipment detection
AU2011305214A1 (en) IP prioritization and scoring system for DDoS detection and mitigation
CN106130786A (en) The detection method of a kind of network failure and device
CN105554009B (en) A method of passing through Network Data Capture device operating system information
CN106357685A (en) Method and device for defending distributed denial of service attack
US20060224886A1 (en) System for finding potential origins of spoofed internet protocol attack traffic
CN103873293B (en) A kind of healthprobe device and method
CN105577669B (en) A kind of method and device of the false source attack of identification
CN107623685A (en) The method and device of quick detection SYN Flood attacks
CN108600228A (en) A kind of IPSec link selecting methods and device
CN106357660A (en) Method and device for detecting IP (internet protocol) of spoofing source in DDOS (distributed denial of service) defense system
CN110213254A (en) A kind of method and apparatus that Internet protocol IP packet is forged in identification
Wette et al. DCT2Gen: A traffic generator for data centers
CN111130936B (en) Method and device for testing load balancing algorithm
WO2013089602A1 (en) Method and trend analyzer for analyzing data in a communication network
CN108512816A (en) A kind of detection method and device that flow is kidnapped
CN104486168A (en) Router wireless performance evaluation system and method
JP6764313B2 (en) Immediate traffic collection / analysis system and method
US20150029892A1 (en) Apparatus for detecting a periodicity, a method thereof and a recording medium thereof
US20210234871A1 (en) Infection-spreading attack detection system and method, and program
Wette et al. DCT ${^ 2} $ Gen: A Versatile TCP Traffic Generator for Data Centers

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20190809

Address after: 518000 Nanshan District science and technology zone, Guangdong, Zhejiang Province, science and technology in the Tencent Building on the 1st floor of the 35 layer

Co-patentee after: Tencent cloud computing (Beijing) limited liability company

Patentee after: Tencent Technology (Shenzhen) Co., Ltd.

Address before: Shenzhen Futian District City, Guangdong province 518000 Zhenxing Road, SEG Science Park 2 East Room 403

Patentee before: Tencent Technology (Shenzhen) Co., Ltd.

TR01 Transfer of patent right