CN116846734A - Sensor fault injection method, device, server and storage medium - Google Patents

Sensor fault injection method, device, server and storage medium Download PDF

Info

Publication number
CN116846734A
CN116846734A CN202310786130.1A CN202310786130A CN116846734A CN 116846734 A CN116846734 A CN 116846734A CN 202310786130 A CN202310786130 A CN 202310786130A CN 116846734 A CN116846734 A CN 116846734A
Authority
CN
China
Prior art keywords
target
fault
fru
sensor
module
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.)
Pending
Application number
CN202310786130.1A
Other languages
Chinese (zh)
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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology 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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202310786130.1A priority Critical patent/CN116846734A/en
Publication of CN116846734A publication Critical patent/CN116846734A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0631Management of faults, events, alarms or notifications using root cause analysis; using analysis of correlation between notifications, alarms or events based on decision criteria, e.g. hierarchy, tree or time analysis
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01DMEASURING NOT SPECIALLY ADAPTED FOR A SPECIFIC VARIABLE; ARRANGEMENTS FOR MEASURING TWO OR MORE VARIABLES NOT COVERED IN A SINGLE OTHER SUBCLASS; TARIFF METERING APPARATUS; MEASURING OR TESTING NOT OTHERWISE PROVIDED FOR
    • G01D18/00Testing or calibrating apparatus or arrangements provided for in groups G01D1/00 - G01D15/00
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

The application provides a sensor fault injection method, a sensor fault injection device, a server and a storage medium, and belongs to the technical field of computers. The method comprises the following steps: receiving a fault injection instruction issued by a user through an external interface provided by the BMC; judging the current working mode of the BMC; judging whether a target FRU module corresponding to the fault injection instruction is a shared device or not under the condition that the current working mode of the BMC is a test mode; and under the condition that the target FRU module corresponding to the fault injection instruction is a shared device, determining a master-slave state of a controller in the target FRU module, and under the condition that the master-slave state of the controller in the target FRU module is dominant, calling a fault injection interface of the target FRU module to transmit the fault injection instruction to the target FRU module, and setting a fault flag bit of the target FRU module to be in a set state. By injecting faults into the sensor in a software manner, the testing efficiency can be improved, and meanwhile, damage to the sensor is reduced.

Description

Sensor fault injection method, device, server and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and apparatus for injecting sensor faults, a server, and a storage medium.
Background
There are many sensors in the storage server that are used to monitor and check many different things, however, once a sensor fails, it can cause a system or control module to malfunction, and thus sensor failure simulation testing is becoming increasingly important. In the related art, a hardware injection mode is adopted to simulate a sensor fault, and the sensor fault scene is constructed by generating certain damage to the sensor or short-circuiting a link in the mode, so that the test efficiency is low, certain damage to the sensor is caused, and unnecessary waste is generated.
Disclosure of Invention
The application provides a sensor fault injection method, a sensor fault injection device, a server and a storage medium, which are used for solving the defects that the test efficiency is low and a certain damage exists to a sensor when a sensor fault is subjected to simulation test in the related technology.
In a first aspect, the present application provides a sensor fault injection method, applied to a server, where the server includes: the method comprises the steps that a baseboard management controller BMC and a plurality of field replaceable unit FRU modules are arranged, the BMC comprises a sensor monitoring module, the sensor monitoring module is used for carrying out alarm judgment on sensor readings reported by the FRU modules, and the method comprises the following steps:
receiving a fault injection instruction issued by a user through an external interface provided by the BMC;
judging the current working mode of the BMC;
judging whether the target FRU module corresponding to the fault injection instruction is a shared device or not under the condition that the current working mode of the BMC is a test mode;
and under the condition that the target FRU module corresponding to the fault injection instruction is a shared device, determining a master-slave state of a controller in the target FRU module, and under the condition that the master-slave state of the controller in the target FRU module is dominant, calling a fault injection interface of the target FRU module to transmit the fault injection instruction to the target FRU module, and setting a fault flag bit of the target FRU module to be in a set state.
In some embodiments, the method further comprises:
and under the condition that the target FRU module detects that the current working mode of the BMC is a test mode and the fault marking position of the target FRU module is in a set state, acquiring the reading of a corresponding sensor through the target FRU module, setting the reading of the sensor as an invalid value, and reporting the reading of the sensor to the sensor monitoring module.
In some embodiments, the method further comprises:
the sensor monitoring module is used for carrying out alarm judgment on the sensor readings reported by all FRU modules received by the sensor monitoring module, and determining whether fault alarms are generated;
under the condition that the occurrence of fault alarms is determined, judging whether the occurrence times of the fault alarms reach a fault tolerance threshold value, and if so, reporting the fault alarms of the sensor device.
In some embodiments, the method further comprises:
and calling a fault injection interface of the target FRU module under the condition that the target FRU module corresponding to the fault injection instruction is a non-shared device, transmitting the fault injection instruction to the target FRU module, and setting a fault flag bit of the target FRU module to be in a set state.
In some embodiments, the method further comprises:
and under the condition that the target FRU module corresponding to the fault injection instruction is a shared device, determining a master-slave state of the controller in the target FRU module, and under the condition that the master-slave state of the controller in the target FRU module is a slave, returning a message which does not support injection fault.
In some embodiments, the method further comprises:
and returning an unsupported injection fault message under the condition that the current working mode of the BMC is a non-test mode.
In some embodiments, the method further comprises:
receiving a fault clearing instruction issued by a user through an external interface provided by the BMC;
and responding to the fault clearing instruction, the BMC exits the test mode, switches back to the normal working mode, clears the fault flag bit of the target FRU module, and enables the target FRU module to acquire sensor readings in a hardware access mode.
In a second aspect, the present application provides a sensor fault injection apparatus, applied to a server, the server comprising: the device comprises a baseboard management controller BMC and a plurality of field replaceable unit FRU modules, wherein the BMC comprises a sensor monitoring module, the sensor monitoring module is used for carrying out alarm judgment on sensor readings reported by the FRU modules, and the device comprises:
the receiving unit is used for receiving a fault injection instruction issued by a user through an external interface provided by the BMC;
the first judging unit is used for judging the current working mode of the BMC;
the second judging unit is used for judging whether the target FRU module corresponding to the fault injection instruction is a shared device or not under the condition that the current working mode of the BMC is a test mode;
the setting unit is used for determining a master-slave state of the controller in the target FRU module under the condition that the target FRU module corresponding to the fault injection instruction is a shared device, calling a fault injection interface of the target FRU module under the condition that the master-slave state of the controller in the target FRU module is dominant, transmitting the fault injection instruction to the target FRU module, and setting a fault flag bit of the target FRU module to be a set state.
In a third aspect, the present application provides a server comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the sensor fault injection method according to any one of the first aspects when executing the program.
In a fourth aspect, the present application provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the sensor fault injection method according to any of the first aspects.
In a fifth aspect, the present application also provides a computer program product comprising a computer program which, when executed by a processor, implements the sensor fault injection method according to any of the first aspects.
According to the sensor fault injection method, the sensor fault injection device, the server and the storage medium, the fault injection instruction issued by a user is received through the external interface provided by the BMC; judging the current working mode of the BMC; judging whether a target FRU module corresponding to the fault injection instruction is a shared device or not under the condition that the current working mode of the BMC is a test mode; and under the condition that the target FRU module corresponding to the fault injection instruction is a shared device, determining a master-slave state of a controller in the target FRU module, and under the condition that the master-slave state of the controller in the target FRU module is dominant, calling a fault injection interface of the target FRU module to transmit the fault injection instruction to the target FRU module, and setting a fault flag bit of the target FRU module to be in a set state. According to the application, the fault is injected into the sensor in a software mode, so that the fault testing efficiency of the analog sensor can be improved, and meanwhile, the damage to the sensor can be reduced.
Drawings
In order to more clearly illustrate the application or the technical solutions in the related art, the following description will briefly explain the drawings used in the embodiments or the related art description, and it is obvious that the drawings in the following description are some embodiments of the application, and other drawings can be obtained according to the drawings without inventive effort for those skilled in the art.
FIG. 1 is a schematic flow chart of a sensor fault injection method according to an embodiment of the present application;
FIG. 2 is a schematic flow chart of obtaining a sensor fault alarm according to an embodiment of the present application;
FIG. 3 is a schematic flow chart of a sensor fault clearing method according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a sensor fault injection apparatus according to an embodiment of the present application;
fig. 5 is a schematic entity structure of a server according to the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The terms first, second and the like in the description and in the claims, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the terms so used are interchangeable under appropriate circumstances such that the embodiments of the application are capable of operation in sequences other than those illustrated or otherwise described herein, and that the "first" and "second" distinguishing between objects generally are not limited in number to the extent that the first object may, for example, be one or more. Furthermore, in the description and claims, "and/or" means at least one of the connected objects, and the character "/" generally means a relationship in which the associated object is an "or" before and after.
Aiming at the defects of lower test efficiency, certain damage to a sensor and the like when the sensor faults are subjected to simulation test in the related technology, the application provides a sensor fault injection method, a device, a server and a storage medium.
The execution main body of the sensor fault injection method provided by the application can be a sensor fault injection device which can be realized through software and/or hardware, the device can be integrated in electronic equipment, and the electronic equipment can be terminal equipment (such as a smart phone, a personal computer, a learning machine and the like), a server (such as a local server or a cloud server, a server cluster and the like), a processor, a chip and the like.
The present application will be described below with reference to fig. 1 to 5 by taking an example in which the execution subject is a sensor fault injection device. It should be noted that, the sensor fault injection method provided by the present application is applied to a server, where the server includes: the BMC comprises a sensor monitoring module, wherein the sensor monitoring module is used for carrying out alarm judgment on sensor readings reported by the FRU modules.
Fig. 1 is a flow chart of a sensor fault injection method according to an embodiment of the present application, as shown in fig. 1, the method includes the following steps: step 110, step 120, step 130 and step 140. The method flow steps are only one possible implementation of the application. The method comprises the following steps:
step 110, receiving a fault injection instruction issued by a user through an external interface provided by the BMC;
it can be understood that the external interface provided by the BMC refers to an interface of the FRU module that needs to inject the fault.
In the specific implementation, when the simulation test is carried out on the sensor faults, the fault injection instruction issued by the user is received through the external interface provided by the BMC.
Step 120, judging the current working mode of the BMC;
further, after receiving the fault injection instruction issued by the user, the current working mode of the BMC needs to be judged at the interface layer.
In general, the operation mode of the BMC is classified into a non-test mode and a test mode. The non-test mode is mainly used in a normal operation mode, in which the actual reading of the sensor is taken, without supporting fault injection of any instructions. The test mode is mainly used for simulating the scene of the abnormal state, and because the fault injection of the sensor is mainly used for functional test verification such as sensor alarm and the like, namely, the fault injection of the target FRU module is only supported under the condition that the current working mode of the BMC is the test mode. Therefore, before fault injection is set, a determination needs to be made as to the current operation mode of the BMC.
Step 130, judging whether the target FRU module corresponding to the fault injection instruction is a shared device or not under the condition that the current working mode of the BMC is a test mode;
it is understood that the target FRU module refers to an FRU module that requires injection of a fault.
Further, in the case that the current working mode of the BMC is a test mode, it is required to determine a sharing attribute of the target FRU module corresponding to the fault injection instruction, where the sharing attribute of the FRU module includes a sharing device and a non-sharing device. And executing step 140 under the condition that the target FRU module corresponding to the fault injection instruction is a shared device.
For the sharing attribute of the target FRU module is a sharing device, because the design condition of the corresponding FRU module only acquires data information on the master controller and then synchronizes the data information to the slave controller, when the sharing device simulates a fault condition, fault injection is needed to be realized on the master controller through the flag bit, the data information is reported to the sensor monitoring module, and faults can be effectively injected, so that the sharing device only supports fault injection on the master controller.
For the sharing attribute of the target FRU module, the corresponding FRU module respectively reads the temperature of the sensor on each controller and then synchronizes the data information to other modules, so that fault injection on any controller can be supported for the non-sharing device.
And 140, determining a master-slave state of a controller in the target FRU module under the condition that the target FRU module corresponding to the fault injection instruction is a shared device, calling a fault injection interface of the target FRU module under the condition that the master-slave state of the controller in the target FRU module is dominant, transmitting the fault injection instruction to the target FRU module, and setting a fault flag bit of the target FRU module to be a set state.
In the implementation, under the condition that the target FRU module corresponding to the fault injection instruction is a shared device, determining the master-slave state of the controller in the target FRU module, and under the condition that the master-slave state of the controller in the target FRU module is the master, supporting to issue the fault injection instruction, and injecting the fault.
Further, the fault injection interface of the target FRU module is called to transmit the fault injection instruction to the target FRU module, and the fault marking bit of the target FRU module is set to be in a setting state, so that the fault injection sensor is implemented in a software mode.
In the embodiment of the application, the fault injection instruction issued by the user is received through the external interface provided by the BMC; judging the current working mode of the BMC; judging whether a target FRU module corresponding to the fault injection instruction is a shared device or not under the condition that the current working mode of the BMC is a test mode; and under the condition that the target FRU module corresponding to the fault injection instruction is a shared device, determining a master-slave state of a controller in the target FRU module, and under the condition that the master-slave state of the controller in the target FRU module is dominant, calling a fault injection interface of the target FRU module to transmit the fault injection instruction to the target FRU module, and setting a fault flag bit of the target FRU module to be in a set state. According to the application, the fault is injected into the sensor in a software mode, so that the fault testing efficiency of the analog sensor can be improved, and meanwhile, the damage to the sensor can be reduced.
In some embodiments, the method further comprises:
and under the condition that the target FRU module detects that the current working mode of the BMC is a test mode and the fault marking position of the target FRU module is in a set state, acquiring the reading of a corresponding sensor through the target FRU module, setting the reading of the sensor as an invalid value, and reporting the reading of the sensor to the sensor monitoring module.
It should be noted that, the sensor fault injection method provided by the application is suitable for the FRU module sensor for independently acquiring the temperature, specifically, the FRU module sensor for independently acquiring the temperature generates a sensor number through the architecture configuration catalog definition file, accesses hardware in the corresponding FRU module to realize the physical scanning of the relevant temperature, provides a temperature reading interface for the sensor monitoring module after the temperature point is acquired, and is used for the sensor monitoring module to be connected with a hook to realize the management and alarm judgment of the sensor reading.
In a specific implementation, when the target FRU module detects that the current working mode of the BMC is a test mode and the fault marking position of the target FRU module is in a set state, the target FRU module is used for collecting the corresponding reading of the sensor, setting the reading of the sensor as an invalid value, and exemplarily setting the set invalid value as FF, so that the fault is injected into the sensor in a software mode, and meanwhile, the reading of the sensor is reported to the sensor monitoring module, and further management and alarm judgment of the reading of the sensor are realized through the sensor monitoring module.
In the embodiment of the application, when the target FRU module detects that the current working mode of the BMC is the test mode and the fault marking position of the target FRU module is in the set state, the corresponding sensor reading is acquired through the target FRU module, the sensor reading is set to be an invalid value, the sensor reading is reported to the sensor monitoring module, the fault is injected into the sensor in a software mode, the fault test efficiency of the analog sensor is improved, the loss of the sensor is reduced, and the material cost is saved.
In some embodiments, fig. 2 is a schematic flow chart of obtaining a sensor fault alarm according to an embodiment of the present application, as shown in fig. 2, where the method further includes:
step 210, through the sensor monitoring module, alarming and judging the sensor readings reported by the FRU modules received by the sensor monitoring module, and determining whether fault alarming occurs;
when the method is implemented, each FRU module reports the sensor reading to the sensor monitoring module, and the sensor monitoring module carries out alarm judgment on the received sensor reading reported by each FRU module to determine whether fault alarm is generated or not;
for example, if the sensor reading reported by the FRU module is invalid, for example, FF, then a fault alarm is determined to be generated.
Step 220, under the condition that the occurrence of fault alarms is determined, judging whether the number of times of occurrence of the fault alarms reaches a fault tolerance threshold, and if so, reporting the fault alarms of the sensor device.
In order to improve the accuracy of the fault alarm of the sensor device and reduce the misjudgment condition, a fault tolerance threshold is set in advance for the times of generating the fault alarm.
In the specific implementation, under the condition that the occurrence of the fault alarm is determined, further judging whether the number of times of occurrence of the fault alarm reaches a fault tolerance threshold, if so, reporting the fault alarm of the sensor device, wherein the fault tolerance threshold is 3 times, and the application is not particularly limited.
In the embodiment of the application, the sensor monitoring module is used for carrying out alarm judgment on the sensor readings reported by all FRU modules received by the sensor monitoring module, so as to determine whether fault alarm is generated; under the condition that the fault alarm is determined to be generated, judging whether the frequency of generating the fault alarm reaches a fault tolerance threshold value, if so, reporting the fault alarm of the sensor device, realizing the verification of the fault alarm function of the sensor, improving the accuracy and the test verification efficiency of the simulated sensor fault test, and saving the time cost.
In some embodiments, the method further comprises:
and calling a fault injection interface of the target FRU module under the condition that the target FRU module corresponding to the fault injection instruction is a non-shared device, transmitting the fault injection instruction to the target FRU module, and setting a fault flag bit of the target FRU module to be in a set state.
It should be noted that, in the case that the target FRU module corresponding to the fault injection instruction is a non-shared device, it may be supported to issue the fault injection instruction in any state of the controller in the target FRU module, and it is not necessary to determine a master-slave state of the controller in the target FRU module.
In the implementation, when the target FRU module corresponding to the fault injection instruction is a non-shared device, a fault injection interface of the target FRU module is called, the fault injection instruction is transmitted to the target FRU module, and a fault flag bit of the target FRU module is set to be in a set state.
In the embodiment of the application, when the target FRU module corresponding to the fault injection instruction is a non-shared device, the fault injection interface of the target FRU module is called, the fault injection instruction is transmitted to the target FRU module, and the fault marking bit of the target FRU module is set in a setting state.
In some embodiments, the method further comprises:
and under the condition that the target FRU module corresponding to the fault injection instruction is a shared device, determining a master-slave state of the controller in the target FRU module, and under the condition that the master-slave state of the controller in the target FRU module is a slave, returning a message which does not support injection fault.
In the implementation, under the condition that the target FRU module corresponding to the fault injection instruction is a shared device, the master-slave state of the controller in the target FRU module is further determined, under the condition that the master-slave state of the controller in the target FRU module is a slave, the fault injection to the sensor is not supported, and the interface returns a prompt message that the fault injection is not supported.
In the embodiment of the application, under the condition that the target FRU module corresponding to the fault injection instruction is a shared device, the master-slave state of the controller in the target FRU module is determined, under the condition that the master-slave state of the controller in the target FRU module is a slave, the injection fault message is returned to be not supported, and under the condition that the master-slave state of the controller in the target FRU module is a slave, the injection fault is not supported, so that the test efficiency can be improved and the time cost can be saved.
In some embodiments, fig. 3 is a schematic flow chart of obtaining sensor fault clearing according to an embodiment of the present application, as shown in fig. 3, where the method further includes:
step 310, receiving a fault clearing instruction issued by a user through an external interface provided by the BMC;
in a specific implementation, the external interface provided by the BMC, that is, the interface of the FRU module that needs to be injected with the fault, receives the fault clearing instruction issued by the user, and step 320 responds to the fault clearing instruction.
And 320, responding to the fault clearing instruction, the BMC exits the test mode, switches back to the normal working mode, clears the fault flag bit of the target FRU module, and enables the target FRU module to acquire sensor readings in a hardware access mode.
In specific implementation, in response to the fault clearing instruction, the BMC exits the test mode, switches back to the non-test mode, i.e., switches back to the normal operation mode, and clears the fault flag bit of the target FRU module to restore the initial value, so that the target FRU module can normally acquire the sensor reading, i.e., restore to acquire the sensor reading through hardware access.
In the embodiment of the application, the fault clearing instruction issued by the user is received through the external interface provided by the BMC; and responding to the fault clearing instruction, the BMC exits the test mode, switches back to the normal working mode, clears the fault marking bit of the target FRU module, so that the target FRU module can acquire the sensor reading in a hardware access mode, and can restore the normal reading of the sensor reading by the target FRU module, thereby realizing the fault clearing of the sensor.
In some embodiments, the method further comprises:
and returning an unsupported injection fault message under the condition that the current working mode of the BMC is a non-test mode.
In the specific implementation, when the simulation test is carried out on the sensor faults, the fault injection instruction issued by the user is received through the external interface provided by the BMC. Further, judging the current working mode of the BMC, and if the current working mode of the BMC is a non-test mode, not supporting to inject faults into the sensor, and returning a prompt message not supporting to inject faults by an interface.
In the embodiment of the application, the injection fault is not supported under the condition that the current working mode of the BMC is a non-test mode, so that the test efficiency can be improved, and the time cost can be saved.
The sensor fault injection device provided by the application is described below, and the sensor fault injection device described below and the sensor fault injection method described above can be referred to correspondingly.
It should be noted that, the sensor fault injection device provided by the present application is applied to a server, and the server includes: the BMC comprises a sensor monitoring module, wherein the sensor monitoring module is used for carrying out alarm judgment on sensor readings reported by the FRU modules.
Fig. 4 is a schematic structural diagram of a sensor fault injection device according to an embodiment of the present application, and as shown in fig. 4, the sensor fault injection device 400 includes:
the receiving unit 410 is configured to receive a fault injection instruction issued by a user through an external interface provided by the BMC;
a first judging unit 420, configured to judge a current working mode of the BMC;
a second judging unit 430, configured to judge whether the target FRU module corresponding to the fault injection instruction is a shared device when the current working mode of the BMC is a test mode;
and the setting unit 440 is configured to determine a master-slave state of the controller in the target FRU module when the target FRU module corresponding to the fault injection instruction is a shared device, and call a fault injection interface of the target FRU module when the master-slave state of the controller in the target FRU module is dominant, so as to transmit the fault injection instruction to the target FRU module, and set a fault flag bit of the target FRU module to a set state.
In some embodiments, the apparatus further comprises:
the collecting and setting reporting unit is used for collecting the reading of the corresponding sensor through the target FRU module and setting the reading of the sensor as an invalid value when the target FRU module detects that the current working mode of the BMC is a test mode and the fault marking position of the target FRU module is in a set state, and reporting the reading of the sensor to the sensor monitoring module.
In some embodiments, the apparatus further comprises:
the fault alarm judging unit is used for judging the alarm of the sensor readings reported by the FRU modules received by the sensor monitoring module through the sensor monitoring module and determining whether fault alarm is generated or not;
the fault-tolerant threshold judging unit is used for judging whether the number of times of generating the fault alarm reaches the fault-tolerant threshold or not under the condition that the fault alarm is determined to be generated, and if so, reporting the fault alarm of the sensor device.
In some embodiments, the apparatus further comprises:
and the fault injection instruction transfer unit is used for calling a fault injection interface of the target FRU module, transferring the fault injection instruction to the target FRU module and setting a fault marking bit of the target FRU module to be in a setting state under the condition that the target FRU module corresponding to the fault injection instruction is a non-sharing device.
In some embodiments, the apparatus further comprises:
and the state determining unit is used for determining the master-slave state of the controller in the target FRU module under the condition that the target FRU module corresponding to the fault injection instruction is a shared device, and returning a fault injection message which is not supported under the condition that the master-slave state of the controller in the target FRU module is a slave.
In some embodiments, the apparatus further comprises:
and the return unit is used for returning a failure message which is not supported to be injected under the condition that the current working mode of the BMC is a non-test mode.
In some embodiments, the apparatus further comprises:
the fault clearing instruction receiving unit is used for receiving a fault clearing instruction issued by a user through an external interface provided by the BMC;
and the fault clearing instruction response unit is used for responding to the fault clearing instruction, the BMC exits the test mode, switches back to the normal working mode, clears the fault marking bit of the target FRU module, and enables the target FRU module to acquire the sensor reading in a hardware access mode.
It should be noted that, the sensor fault injection device provided by the embodiment of the present application can implement all the method steps implemented by the embodiment of the sensor fault injection method, and can achieve the same technical effects, and detailed descriptions of the same parts and beneficial effects as those of the embodiment of the method in the embodiment are omitted.
It should be noted that each embodiment of the present application may be freely combined, exchanged in order, or separately executed, and does not need to rely on or rely on a fixed execution sequence.
Fig. 5 is a schematic entity structure diagram of a server according to the present application, as shown in fig. 5, where the server may include: processor 510, communication interface (Communications Interface) 520, memory 530, and communication bus 540, wherein processor 510, communication interface 520, memory 530 complete communication with each other through communication bus 540. Processor 510 may invoke logic instructions in memory 530 to perform a sensor fault injection method comprising: receiving a fault injection instruction issued by a user through an external interface provided by the BMC; judging the current working mode of the BMC; judging whether the target FRU module corresponding to the fault injection instruction is a shared device or not under the condition that the current working mode of the BMC is a test mode; and under the condition that the target FRU module corresponding to the fault injection instruction is a shared device, determining a master-slave state of a controller in the target FRU module, and under the condition that the master-slave state of the controller in the target FRU module is dominant, calling a fault injection interface of the target FRU module to transmit the fault injection instruction to the target FRU module, and setting a fault flag bit of the target FRU module to be in a set state.
Further, the logic instructions in the memory 530 described above may be implemented in the form of software functional units and may be stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the related art or in a part of the technical solution, in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In another aspect, the present application also provides a computer program product, the computer program product including a computer program, the computer program being storable on a non-transitory computer readable storage medium, the computer program, when executed by a processor, being capable of executing the sensor fault injection method provided by the above methods, the method comprising: receiving a fault injection instruction issued by a user through an external interface provided by the BMC; judging the current working mode of the BMC; judging whether the target FRU module corresponding to the fault injection instruction is a shared device or not under the condition that the current working mode of the BMC is a test mode; and under the condition that the target FRU module corresponding to the fault injection instruction is a shared device, determining a master-slave state of a controller in the target FRU module, and under the condition that the master-slave state of the controller in the target FRU module is dominant, calling a fault injection interface of the target FRU module to transmit the fault injection instruction to the target FRU module, and setting a fault flag bit of the target FRU module to be in a set state.
In yet another aspect, the present application also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, is implemented to perform the sensor fault injection method provided by the above methods, the method comprising: receiving a fault injection instruction issued by a user through an external interface provided by the BMC; judging the current working mode of the BMC; judging whether the target FRU module corresponding to the fault injection instruction is a shared device or not under the condition that the current working mode of the BMC is a test mode; and under the condition that the target FRU module corresponding to the fault injection instruction is a shared device, determining a master-slave state of a controller in the target FRU module, and under the condition that the master-slave state of the controller in the target FRU module is dominant, calling a fault injection interface of the target FRU module to transmit the fault injection instruction to the target FRU module, and setting a fault flag bit of the target FRU module to be in a set state.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present application without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on such understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the related art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and are not limiting; although the application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims (10)

1. A sensor fault injection method, applied to a server, the server comprising: the method comprises the steps that a baseboard management controller BMC and a plurality of field replaceable unit FRU modules are arranged, the BMC comprises a sensor monitoring module, the sensor monitoring module is used for carrying out alarm judgment on sensor readings reported by the FRU modules, and the method comprises the following steps:
receiving a fault injection instruction issued by a user through an external interface provided by the BMC;
judging the current working mode of the BMC;
judging whether the target FRU module corresponding to the fault injection instruction is a shared device or not under the condition that the current working mode of the BMC is a test mode;
and under the condition that the target FRU module corresponding to the fault injection instruction is a shared device, determining a master-slave state of a controller in the target FRU module, and under the condition that the master-slave state of the controller in the target FRU module is dominant, calling a fault injection interface of the target FRU module to transmit the fault injection instruction to the target FRU module, and setting a fault flag bit of the target FRU module to be in a set state.
2. The sensor fault injection method of claim 1, further comprising:
and under the condition that the target FRU module detects that the current working mode of the BMC is a test mode and the fault marking position of the target FRU module is in a set state, acquiring the reading of a corresponding sensor through the target FRU module, setting the reading of the sensor as an invalid value, and reporting the reading of the sensor to the sensor monitoring module.
3. The sensor fault injection method of claim 2, further comprising:
the sensor monitoring module is used for carrying out alarm judgment on the sensor readings reported by all FRU modules received by the sensor monitoring module, and determining whether fault alarms are generated;
under the condition that the occurrence of fault alarms is determined, judging whether the occurrence times of the fault alarms reach a fault tolerance threshold value, and if so, reporting the fault alarms of the sensor device.
4. The sensor fault injection method of claim 1, further comprising:
and calling a fault injection interface of the target FRU module under the condition that the target FRU module corresponding to the fault injection instruction is a non-shared device, transmitting the fault injection instruction to the target FRU module, and setting a fault flag bit of the target FRU module to be in a set state.
5. The sensor fault injection method of claim 1, further comprising:
and under the condition that the target FRU module corresponding to the fault injection instruction is a shared device, determining a master-slave state of the controller in the target FRU module, and under the condition that the master-slave state of the controller in the target FRU module is a slave, returning a message which does not support injection fault.
6. The sensor fault injection method of claim 1, further comprising:
and returning an unsupported injection fault message under the condition that the current working mode of the BMC is a non-test mode.
7. The sensor fault injection method of claim 1, further comprising:
receiving a fault clearing instruction issued by a user through an external interface provided by the BMC;
and responding to the fault clearing instruction, the BMC exits the test mode, switches back to the normal working mode, clears the fault flag bit of the target FRU module, and enables the target FRU module to acquire sensor readings in a hardware access mode.
8. A sensor fault injection apparatus, characterized by being applied to a server, the server comprising: the device comprises a baseboard management controller BMC and a plurality of field replaceable unit FRU modules, wherein the BMC comprises a sensor monitoring module, the sensor monitoring module is used for carrying out alarm judgment on sensor readings reported by the FRU modules, and the device comprises:
the receiving unit is used for receiving a fault injection instruction issued by a user through an external interface provided by the BMC;
the first judging unit is used for judging the current working mode of the BMC;
the second judging unit is used for judging whether the target FRU module corresponding to the fault injection instruction is a shared device or not under the condition that the current working mode of the BMC is a test mode;
the setting unit is used for determining a master-slave state of the controller in the target FRU module under the condition that the target FRU module corresponding to the fault injection instruction is a shared device, calling a fault injection interface of the target FRU module under the condition that the master-slave state of the controller in the target FRU module is dominant, transmitting the fault injection instruction to the target FRU module, and setting a fault flag bit of the target FRU module to be a set state.
9. A server comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the sensor fault injection method of any one of claims 1 to 7 when the program is executed.
10. A non-transitory computer readable storage medium, having stored thereon a computer program, wherein the computer program when executed by a processor implements the sensor fault injection method according to any of claims 1 to 7.
CN202310786130.1A 2023-06-29 2023-06-29 Sensor fault injection method, device, server and storage medium Pending CN116846734A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310786130.1A CN116846734A (en) 2023-06-29 2023-06-29 Sensor fault injection method, device, server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310786130.1A CN116846734A (en) 2023-06-29 2023-06-29 Sensor fault injection method, device, server and storage medium

Publications (1)

Publication Number Publication Date
CN116846734A true CN116846734A (en) 2023-10-03

Family

ID=88173680

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310786130.1A Pending CN116846734A (en) 2023-06-29 2023-06-29 Sensor fault injection method, device, server and storage medium

Country Status (1)

Country Link
CN (1) CN116846734A (en)

Similar Documents

Publication Publication Date Title
CN109471770B (en) System management method and device
CN112286709B (en) Diagnosis method, diagnosis device and diagnosis equipment for server hardware faults
CN111414268B (en) Fault processing method and device and server
CN105183575A (en) Processor fault diagnosis method, device and system
CN116107819A (en) Server start-up fault detection system, method, device and medium
CN111881014A (en) System test method, device, storage medium and electronic equipment
CN112527582A (en) Detection method, detection device, detection equipment and storage medium of server cable
CN111581043A (en) Server power consumption monitoring method and device and server
CN114978883B (en) Network wakeup management method and device, electronic equipment and storage medium
CN110489287B (en) Method, system and storage medium for testing hot plug through Ipomitool
CN113672306B (en) Server component self-checking abnormity recovery method, device, system and medium
CN108255717A (en) Interface automatic test optimization method, system, electronic equipment and storage medium
CN115118646B (en) Data interaction method and device for switch test system and electronic equipment
CN109597389A (en) A kind of test macro of embedded control system
CN116846734A (en) Sensor fault injection method, device, server and storage medium
CN113992501A (en) Fault positioning system, method and computing device
CN116680101A (en) Method and device for detecting downtime of operating system, and method and device for eliminating downtime of operating system
CN116048959A (en) Website testing method, device, equipment and storage medium
CN106909489B (en) Method and device for testing EventLog state
CN112383462A (en) Network device and bus configuration method
CN116915583B (en) Communication abnormality diagnosis method, device and electronic equipment
CN108388488A (en) A kind of intelligent platform management system and fault handling method
CN115934446A (en) Self-checking method, server, equipment and storage medium
CN115658373B (en) Server-based memory processing method and device, processor and electronic equipment
US20240159812A1 (en) Method for monitoring in a distributed system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination