Summary of the invention
The invention provides a kind of detection method of sensor function, can test for every kind of abnormality of all the sensors in the server, whether perfect with replacement (rearm) function that checks sensor.
The present invention proposes a kind of detection method of sensor function, and in order to detect the function of reset of sensor in the server, wherein sensor can be in the wherein a kind of of normal condition or at least one abnormality.In the method, at first obtain the corresponding resetting type of function of reset of sensor.Then trigger sensor enters every kind of abnormality respectively, and trigger sensor leaves the abnormality that enters.All can automatically revert to normal condition when leaving wherein a kind of abnormality if resetting type is automatic resetting type and sensor being triggered at every turn, judge that then its function of reset is normal.If all receiving one when leaving wherein a kind of abnormality and reset just to reply after the order and be normal condition being triggered at every turn yet resetting type is non-automatic resetting type and sensor, judging that its function of reset is normal.
In one embodiment of this invention, wherein server comprises baseboard management controller (BaseboardManagement Controller, BMC), and the step that obtains the corresponding resetting type of function of reset comprises that the Sensor Data Record (Sensor Data Record, SDR) that reads in the baseboard management controller is to distinguish the resetting type of sensor.In addition, Sensor Data Record also comprises the corresponding relation between record sensor and normal condition and each abnormality.
In one embodiment of this invention, after wherein the trigger sensor step that enters every kind of abnormality is included in trigger sensor and enters wherein a kind of abnormality respectively, judge whether sensor has been in the abnormality that triggers.If sensor is not in the abnormality that triggers, then the state of determine sensor control function (status function) is unusual.
In one embodiment of this invention, wherein after judging whether sensor has been in the step of the abnormality that triggers, trigger sensor leaves present abnormality when also being included in sensor and being in the abnormality that triggers, and judges whether sensor replys and be normal condition.If the resetting type of sensor is automatic resetting type and sensor does not reply and be normal condition, judge that then its function of reset is unusual.Automatically revert to normal condition if resetting type is non-automatic resetting type and sensor, judge that then its function of reset is unusual.
In one embodiment of this invention, wherein after judging whether sensor replys step into normal condition, when also being included in resetting type and being non-automatic resetting type and sensor and not replying as normal condition, transmitting resets orders to sensor.And if the described sensor that has received described replacement order can't reply and be normal condition, judge that then its function of reset is unusual.
In one embodiment of this invention, wherein transmit replacement and order the baseboard management controller transmission replacement order that comprises Control Server to the step of sensor.
In one embodiment of this invention, can't reply and be described normal condition if wherein received the described sensor of described replacement order, judge that then the unusual step of described function of reset comprises:
Described sensor is obtained a sensing value again to judge that whether described sensor is as described normal condition after receiving described replacement order; And
If described sensor is not described normal condition, judge that then described function of reset is unusual.
In one embodiment of this invention, wherein the trigger sensor step that enters or leave every kind of abnormality comprises the criterion that changes each abnormality, and setting sensor enters or leave each abnormality according to this.
Whether based on above-mentioned, the sensor that the present invention triggers in the server enters respectively and leaves corresponding every kind of abnormality, and come the function of reset of determine sensor perfect according to the kind of its function of reset and the situation that returns back to normal condition.To no longer need to check in the mode of taking a sample test the function of reset of sensor thus, and no matter be that the automatic or nonautomatic function of resurveying can both thoroughly be detected.
For above-mentioned feature and advantage of the present invention can be become apparent, embodiment cited below particularly, and cooperate appended graphic being described in detail below.
Embodiment
Following embodiment will be take the sensor in the server as example, and normally whether replacement (rearm) function that test sensors be described detailed step.Wherein, sensor for example is the various environmental informations such as temperature, voltage, the rotation speed of the fan that measures server inside, or power supply status, in this kind of limiting sensor not.And sensor can according to measurement to data and default criterion switch to different states, sensor comprises a kind of normal condition and one or more abnormality in the present embodiment.In addition, different based on sensor applications and characteristic, the function of reset that the control sensor returns back to normal condition by various abnormality has also comprised two kinds of automatic resetting type and non-automatic resetting type.
Fig. 1 is the process flow diagram of the detection method of the sensor function that illustrates according to one embodiment of the invention.See also Fig. 1, at first shown in step 110, for the present sensor that will detect, obtain resetting type corresponding to its function of reset.In the present embodiment, the server internal configurations has baseboard management controller (Baseboard Management Controller, BMC), and (the Sensor Data Record of the Sensor Data Record in the baseboard management controller, SDR) then can put down in writing the indivedual corresponding resetting type of all the sensors in the server, and included normal condition and the abnormality of sensor.Therefore, just can the corresponding resetting type of identification sensor by the read sensor data recording, also can obtain the various abnormality that sensor is supported simultaneously.Should be noted that, sensor is put at one time and can be in normal condition or be in wherein a kind of abnormality.
Then in step 120, trigger sensor enters the various abnormality of support respectively, and trigger sensor leaves the abnormality that enters.Wherein, the various abnormality of sensor are corresponding different criterion respectively, and trigger sensor enters or the mode of leaving abnormality for example is to finish by the numerical value that changes criterion.Take temperature sensor with a normal condition and an abnormality as example, suppose that the corresponding criterion of normal condition is for being less than or equal to the corresponding criterion of 10 degree abnormality for spending greater than 10, so when temperature sensor measures to temperature be 12 when spending, temperature sensor should belong to abnormality.Yet, be less than or equal to 15 degree and the corresponding criterion of abnormality changes to greater than 15 degree if the corresponding criterion of normal condition changed to, after changing criterion, will change its state by trigger sensor so.
If its resetting type of the sensor that detects is non-automatic resetting type, so shown in step 130, if sensor is normal condition being triggered could reply after all must by the time receiving the order of resetting when leaving wherein a kind of abnormality at every turn, then the function of reset of sensor will be judged as normally.In other words, belong to the sensor of non-automatic resetting type when needs return back to normal condition, the replacement order of must the dependence system sending just can be carried out.
If its resetting type of the sensor that detects is automatic resetting type, then shown in step 140, in the situation that being triggered at every turn, sensor all can automatically return to normal condition when leaving wherein a kind of abnormality, and the function of reset of determine sensor is normal.That is, support the sensor of automatically resetting should possess being triggered at every turn and automatically replied the ability of normal condition after leaving a kind of abnormality.
According to the different different judgement detection modes of sensor resetting type definition in detection method shown in Figure 1, when trigger sensor enters and leaves its corresponding every kind of abnormality, just can reply according to resetting type, the sensor of sensor and be normal condition, and be also to automatically revert to normal condition or must rely on the order of resetting just to return back to the function of reset quality that normal condition is judged sensor.What must specify is, although above-described embodiment is that to detect a sensor be that example comes that the present invention will be described, whether all the sensors in the server all can check its function of reset normal by each step shown in Figure 1.That is to say, no longer need to come by the mode of taking a sample test the function of reset of verificating sensor, this detection method can produce a more comprehensively testing result of property.
Fig. 2 is the process flow diagram of the detection method of the sensor function that illustrates according to another embodiment of the present invention.Can the present embodiment will further illustrate the detailed step that return to normal condition and then judgement function of reset quality according to the sensor of different resetting type under various abnormality.See also Fig. 2, at first shown in step 210, by the Sensor Data Record in the baseboard management controller that reads server, with the corresponding resetting type of the function of reset of obtaining sensor.In the present embodiment, resetting type comprises automatic resetting type and non-automatic resetting type.
Because sensor can be in the wherein a kind of of several abnormality, or is in a normal condition, therefore in step 215, from corresponding all abnormality of sensor, select wherein a kind of abnormality, and trigger sensor enters selected abnormality.In the present embodiment, can come trigger sensor to enter this abnormality by the criterion that changes abnormality.
Then shown in step 220, judge whether sensor has been in the abnormality that triggers after finishing above-mentioned trigger action.If sensor is not in the abnormality that triggers, then shown in step 225, the unusual also flow process of detection of end method of the state control function (status function) of determine sensor, and then the research staff of sensor can be revised for this function.
If sensor is in the abnormality that triggers immediately after being triggered, then shown in step 230, trigger sensor leaves this abnormality.The mode of criterion that for instance, can be by changing this abnormality comes trigger sensor to leave abnormality.
In ensuing testing process, whether normally its function of reset will be detected with different criterions for different sensor resetting type.In one embodiment, the resetting type of supposing to obtain the sensor that will detect in step 210 is non-automatic resetting type, just then shown in step 240, judge whether sensor automatically reverts to normal condition.Because the resetting type of sensor is non-automatic resetting type, if thereby sensor immediately answer after being triggered is normal condition, then shown in step 250, the function of reset of determine sensor is making a mistake sensor when abnormality returns back to normal condition thus, and finishes the flow process of this detection method.
Yet after trigger sensor leaves abnormality, if sensor does not automatically return to normal condition, then in step 245, transmit a replacement and order to sensor.In the present embodiment, for example be that baseboard management controller in the Control Server is sent to sensor with replacement order.Sensor then can be obtained sensing value again after receiving the order of resetting, determine whether according to this normal condition.
Next shown in step 260, judge again whether the sensor that receives after the order of resetting replys and be normal condition.Be normal condition if sensor still can't be replied, then shown in step 250, the function of reset of determine sensor is the flow process of detection of end method unusually also.That is the function of reset of sensor can't correctly return back to normal condition with sensor by the abnormality in detecting.
Otherwise, if having replied, sensor is normal condition, then in step 265, judge whether in addition other abnormality that not yet detected.If also have other abnormality not yet detected, then get back to step 215 and again obtain the another kind of abnormality that sensor is supported, and whether repeatedly carry out above-mentioned steps unusual with the function of reset of judging sensor.If it is complete that all abnormality of sensor have all detected, and all must through the over-reset order, judge shown in step 270 that then the function of reset of sensor is normal when wherein a kind of abnormality returns back to normal condition at every turn.That is the function of reset of sensor can return back to normal condition with sensor by every kind of abnormality supporting according to its resetting type.
Please get back to the step 230 of Fig. 2, the resetting type of supposing in another embodiment sensor is automatic resetting type, so shown in step 280, judges that can sensor be normal condition being triggered reply after leaving abnormality.If sensor does not automatically return to normal condition, then shown in step 250, the function of reset of determine sensor is wrong, namely function of reset can't be smoothly with sensor thus abnormality return back to normal condition, so far will finish the flow process of this detection method.
If yet sensor can automatically revert to normal condition after leaving abnormality being triggered, and judges whether in step 285 that then other abnormality is detected in addition.If it is complete that all abnormality of this sensor have all detected, then shown in step 270, the function of reset of determine sensor can normally automatically revert to normal condition with sensor by various abnormality, finishes simultaneously this detection method.If still have other abnormality not yet to detect, then get back to step 215 and obtain the another kind of abnormality that sensor is supported, and repeatedly carry out above-mentioned steps with the quality of the function of reset of judgement sensor.
In server, hundreds of sensors may be arranged, and each sensor all can detect its function of reset by each step shown in Figure 2 can normal operation.In other words, as long as just can learn the number of sensors in the server, the resetting type of each sensor by the Sensor Data Record that reads in the baseboard management controller, and all abnormality of supporting.It enters and leaves each abnormality successively the sensor-triggered that then detects for institute's wish, and the standard whether situation that at every turn returns back to normal condition according to sensor again meets its resetting type judges that normally whether function of reset.
In sum, the flow process that the detection method of sensor function of the present invention provides a cover automatically to detect, can detect for the function of reset of all the sensors in the server, can correctly reply as normal condition according to its resetting type when judging the various abnormality that sensor supported being in.To replace accordingly in the past and only can come to take a sample test mode the practice of verificating sensor function of reset, and then can obtain one and have high confidence level and comprehensive testing result.
It should be noted that at last: above embodiment only in order to technical scheme of the present invention to be described, is not intended to limit; Although with reference to previous embodiment the present invention is had been described in detail, those of ordinary skill in the art is to be understood that: it still can be made amendment to the technical scheme that aforementioned each embodiment puts down in writing, and perhaps part technical characterictic wherein is equal to replacement; And these modifications or replacement do not make the essence of appropriate technical solution break away from the spirit and scope of various embodiments of the present invention technical scheme.