Device monitoring method, product, device and storage medium

By using the monitoring main process in a white box switch to obtain device hardware information and create monitoring subprocesses for independent monitoring, the problem of monitoring programs being unavailable when the device fails, improving monitoring efficiency and stability.

CN119003285BActive Publication Date: 2025-02-25INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411479324.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-22
Publication Date
2025-02-25
Estimated Expiration
2044-10-22

AI Technical Summary

Technical Problem

The monitoring program of the white box switch will cause the entire monitoring program to be unavailable when the device hardware fails, reducing the operating efficiency.

Method used

By monitoring the main process, obtaining device hardware information, creating corresponding monitoring subprocesses, independently monitoring the device hardware, and monitoring the main process to monitor the status of the subprocess.

Benefits of technology

It realizes adaptive adaptation of the equipment hardware monitoring program, improves the system's working efficiency, and improves the stability and efficiency of the monitoring program.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119003285B_ABST
    Figure CN119003285B_ABST
Patent Text Reader

Abstract

The embodiments of the present application relate to the field of information technology, and specifically to a device monitoring method, product, device and storage medium, which are intended to improve the operating efficiency of the device monitoring program. The method comprises: obtaining device hardware information stored in the memory of the device through the device monitoring main process; creating at least one corresponding monitoring sub-process according to the device hardware information through the monitoring main process; monitoring the operating status of the corresponding device hardware in the device through the at least one monitoring sub-process; and monitoring the operating status of the at least one monitoring sub-process through the monitoring main process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of information technology, and in particular to a device monitoring method, product, device and storage medium. Background Art

[0002] A white box switch is a flexible and efficient network device. Users can deploy different personalized applications and services in the white box switch as needed. During the operation of the white box switch, it is necessary to monitor the hardware of each device of the white box switch to ensure the normal operation of the white box switch. In the related art, the white box switch runs a monitoring program in the background to monitor all the device hardware of the white box switch as a whole.

[0003] In the related art, when a hardware failure occurs in a device of a white-box switch, the entire monitoring program will become unavailable, thereby reducing the operating efficiency of the entire monitoring program. Summary of the invention

[0004] The embodiments of the present application provide a device monitoring method, product, device and storage medium, aiming to improve the operating efficiency of the device monitoring program.

[0005] A first aspect of an embodiment of the present application provides a device monitoring method, the method comprising:

[0006] Acquire the device hardware information stored in the memory of the device through the monitoring main process of the device;

[0007] By means of the monitoring main process, at least one corresponding monitoring sub-process is created according to the device hardware information;

[0008] By means of the at least one monitoring subprocess, the operating status of the corresponding device hardware in the device is monitored respectively;

[0009] The operating status of the at least one monitoring sub-process is monitored through the monitoring main process.

[0010] Optionally, before acquiring the device hardware information stored in the memory of the device through the monitoring main process of the device, the method further includes:

[0011] Obtaining the device hardware information of each device hardware in the device;

[0012] The device hardware information is stored in the memory of the device in a preset data format.

[0013] Optionally, creating at least one corresponding monitoring sub-process according to the device hardware information through the monitoring main process includes:

[0014] Parsing the device hardware information through the monitoring main process to obtain monitoring indicator data of at least one device hardware in the device;

[0015] According to the monitoring indicator data of each device hardware, the monitoring subprocess corresponding to the device hardware is created.

[0016] Optionally, creating the monitoring subprocess corresponding to the device hardware according to the monitoring indicator data of each device hardware includes:

[0017] Determine the process type of the monitoring subprocess corresponding to the device hardware according to the monitoring indicator data of each device hardware;

[0018] According to the process type, the corresponding sub-process function is called to create a monitoring sub-process corresponding to the device hardware.

[0019] Optionally, the method further comprises:

[0020] The device hardware name, monitoring threshold, and scanning interval of the device hardware are imported into the monitoring subprocess.

[0021] Optionally, the monitoring the operating status of the corresponding device hardware in the device respectively through the at least one monitoring subprocess includes:

[0022] For each of the device hardware, at every preset time interval, the monitoring indicator data of the device hardware is obtained through the monitoring subprocess;

[0023] The monitoring indicator data is compared with a preset monitoring threshold value through the monitoring subprocess to obtain a comparison result;

[0024] According to the comparison result, it is determined whether the device hardware is abnormal.

[0025] Optionally, the method further comprises:

[0026] When it is determined that the hardware of the device is abnormal, the corresponding abnormal data is recorded in the system log of the device;

[0027] sending the abnormal data to a shared database of the device;

[0028] The abnormal data is reported to the monitoring main process.

[0029] Optionally, monitoring the running status of the at least one monitoring sub-process by the monitoring main process includes:

[0030] Receiving, through the monitoring main process, the running status data reported by each of the monitoring sub-processes;

[0031] When receiving the running status data reported by the monitoring subprocess indicating that the monitoring subprocess is abnormal, restarting the monitoring subprocess;

[0032] When the monitoring subprocess is successfully restarted, continue to monitor the running status of the monitoring subprocess;

[0033] When the number of restart failures of the monitoring subprocess reaches a preset restart number threshold, an alarm message corresponding to the monitoring subprocess is generated.

[0034] Optionally, the method further comprises:

[0035] For each of the monitoring subprocesses, when abnormal data is detected in the corresponding device hardware, a scanning time interval for the device hardware is shortened, and / or a monitoring threshold corresponding to the device hardware is adjusted;

[0036] Furthermore, when it is monitored within a preset time period that the values ​​of the operating status data of the device hardware are all within the range specified by the monitoring threshold, the normal scanning time interval and / or the monitoring threshold corresponding to the device hardware is restored.

[0037] Optionally, the method further comprises:

[0038] When no abnormal data is detected in the device hardware within a preset time period, the scanning time interval for the device hardware is increased, and / or the monitoring threshold corresponding to the device hardware is adjusted.

[0039] Optionally, the method further comprises:

[0040] Storing the running status data monitored by the monitoring subprocess in a shared database of the device;

[0041] The monitoring subprocess obtains the running status data corresponding to the monitoring subprocess of the same type from the shared database;

[0042] The monitoring subprocess adjusts the monitoring strategy according to the running status data.

[0043] Optionally, each of the monitoring subprocesses adjusts the monitoring strategy according to the running status data, including:

[0044] The monitoring subprocess adjusts a scanning time interval of the monitoring subprocess for the corresponding device hardware according to the running status data, and adjusts a monitoring threshold corresponding to the device hardware.

[0045] A second aspect of an embodiment of the present application provides a computer program product, including a computer program / instructions, characterized in that when the computer program / instructions are executed by a processor, the steps in the method described in the first aspect of the present application are implemented.

[0046] A third aspect of an embodiment of the present application provides a device monitoring apparatus, the device comprising:

[0047] A device hardware information acquisition module is used to acquire the device hardware information stored in the memory of the device through the device monitoring main process;

[0048] A monitoring sub-process creation module, used to create at least one corresponding monitoring sub-process according to the device hardware information through the monitoring main process;

[0049] A first monitoring module, configured to monitor the operating status of corresponding device hardware in the device through the at least one monitoring subprocess;

[0050] The second monitoring module is used to monitor the running status of the at least one monitoring sub-process through the monitoring main process.

[0051] Optionally, the device further comprises:

[0052] A device hardware information collection module, used to obtain the device hardware information of each device hardware in the device;

[0053] The device hardware information storage module is used to store the device hardware information in the memory of the device in a preset data format.

[0054] Optionally, the monitoring subprocess creation module includes:

[0055] An information parsing submodule, used to parse the device hardware information through the monitoring main process to obtain monitoring indicator data of at least one device hardware in the device;

[0056] The monitoring sub-process creation sub-module is used to create the monitoring sub-process corresponding to the device hardware according to the monitoring indicator data of each device hardware.

[0057] Optionally, the monitoring subprocess creation submodule includes:

[0058] A process type determination submodule, used to determine the process type of the monitoring subprocess corresponding to the device hardware according to the monitoring indicator data of each device hardware;

[0059] The function calling submodule is used to call the corresponding subprocess function according to the process type and create a monitoring subprocess corresponding to the device hardware.

[0060] Optionally, the device further comprises:

[0061] The data import submodule is used to import the device hardware name, monitoring threshold, and scanning interval time of the device hardware into the monitoring subprocess.

[0062] Optionally, the first monitoring module includes:

[0063] A data acquisition submodule, used for acquiring monitoring index data of the device hardware through the monitoring subprocess at a preset time interval for each device hardware;

[0064] A data comparison submodule, used to compare the monitoring indicator data with a preset monitoring threshold through the monitoring subprocess to obtain a comparison result;

[0065] The abnormality determination submodule is used to determine whether an abnormality occurs in the device hardware according to the comparison result.

[0066] Optionally, the device further comprises:

[0067] A data recording submodule, for recording corresponding abnormal data in a system log of the device when it is determined that the device hardware is abnormal;

[0068] A data sharing submodule, used for sending the abnormal data to a shared database of the device;

[0069] The abnormality reporting submodule is used to report the abnormal data to the monitoring main process.

[0070] Optionally, the second monitoring module includes:

[0071] A data receiving submodule, used for receiving the running status data reported by each monitoring subprocess through the monitoring main process;

[0072] The monitoring subprocess restart submodule is used to restart the monitoring subprocess when receiving the running status data reported by the monitoring subprocess indicating that the monitoring subprocess is abnormal;

[0073] A monitoring continuation submodule, used for continuing to monitor the running status of the monitoring subprocess when the monitoring subprocess is successfully restarted;

[0074] The alarm information generation submodule is used to generate alarm information corresponding to the monitoring subprocess when the number of restart failures of the monitoring subprocess reaches a preset restart number threshold.

[0075] Optionally, the device further comprises:

[0076] A first monitoring strategy adjustment module is used for shortening the scanning time interval of the device hardware and / or adjusting the monitoring threshold corresponding to the device hardware for each of the monitoring subprocesses when abnormal data of the corresponding device hardware is monitored;

[0077] The monitoring strategy recovery module is used to restore the normal scanning time interval and / or the monitoring threshold corresponding to the device hardware when the values ​​of the operating status data of the device hardware are monitored within the range specified by the monitoring threshold within a preset time period.

[0078] Optionally, the device further comprises:

[0079] The second monitoring strategy adjustment module is used to increase the scanning time interval of the device hardware and / or adjust the monitoring threshold corresponding to the device hardware when no abnormal data is detected in the device hardware within a preset time period.

[0080] Optionally, the device further comprises:

[0081] A data sharing module, used for storing the running status data monitored by the monitoring subprocess into a shared database of the device;

[0082] A data acquisition module, used for the monitoring subprocess to acquire the running status data corresponding to the monitoring subprocess of the same type from the shared database;

[0083] The third strategy adjustment module is used for the monitoring subprocess to adjust the monitoring strategy according to the running status data.

[0084] Optionally, the third policy adjustment module includes:

[0085] The monitoring strategy adjustment submodule is used to adjust the scanning time interval of the monitoring subprocess for the corresponding device hardware according to the running status data, and to adjust the monitoring threshold corresponding to the device hardware.

[0086] A fourth aspect of an embodiment of the present application provides a readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps in the method described in the first aspect of the present application are implemented.

[0087] A fifth aspect of an embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the method described in the first aspect of the present application are implemented.

[0088] By adopting the device monitoring method proposed in the present application, the device hardware information stored in the memory of the device is obtained through the device's monitoring main process; through the monitoring main process, at least one corresponding monitoring sub-process is created according to the device hardware information; through the at least one monitoring sub-process, the corresponding device hardware in the device is respectively monitored for operating status; and the operating status of the at least one monitoring sub-process is monitored through the monitoring main process.

[0089] In the present application, the device hardware information of the white-box switch is pre-stored in the memory of the white-box switch. When the device is started, the device hardware information is read through the monitoring main process and a monitoring sub-process is created for each device hardware, thereby realizing adaptive adaptation of the device hardware monitoring program. There is no need to readjust the coding for different platforms, thereby improving the work efficiency of the system. In addition, a corresponding monitoring sub-process is created for each device hardware, and no overall monitoring is performed. If a single sub-process exits, it will not affect other sub-processes, thereby improving the stability of the monitoring program operation. Each device hardware has a corresponding monitoring sub-process for monitoring, thereby improving the efficiency, accuracy and flexibility of monitoring. BRIEF DESCRIPTION OF THE DRAWINGS

[0090] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0091] Figure 1 is a flow chart of a device monitoring method proposed in one embodiment of the present application;

[0092] Figure 2 It is a schematic diagram of the monitoring program structure proposed in one embodiment of the present application;

[0093] Figure 3 This is a schematic diagram of the monitoring process operation flow proposed in an embodiment of the present application;

[0094] Figure 4 This is a schematic diagram of the monitoring sub-process control flow proposed in an embodiment of the present application;

[0095] Figure 5 is a schematic diagram of a device monitoring device proposed in an embodiment of the present application;

[0096] Figure 6 It is a schematic diagram of an electronic device proposed in an embodiment of the present application. DETAILED DESCRIPTION

[0097] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0098] refer to Figure 1 , Figure 1 1 is a flow chart of a device monitoring method proposed in one embodiment of the present application. Figure 1 As shown, the method comprises the following steps:

[0099] S11: Acquire the device hardware information stored in the memory of the device through the monitoring main process of the device.

[0100] In this embodiment, the device may be a server, a white box switch, or other related devices. This example is described by taking a white box switch as an example. A white box switch is an open network device with decoupled soft and hardware devices, which has the characteristics of flexibility, high efficiency, and programmability, and can significantly reduce the cost of network deployment. A white box switch is divided into two parts: device hardware and software. The device hardware generally includes a switching chip, a central processing unit (CPU), a network card, storage, and peripheral hardware devices, etc. The software refers to a network operating system (NOS, Network Operation system) and its network application program. The monitoring main process is a process generated when the monitoring program is running. The memory is an EEPROM (Electrically Erasable Programmable read only memory) electrically erasable programmable read-only memory. It is a storage chip in which data is not lost after power failure. EEPROM can erase existing information and reprogram on a computer or a dedicated device. The device hardware information is the relevant information of all the hardware in the device (white box switch) being monitored, including the number of device hardware in the white box switch, the specific parameters of each device hardware, and the standard threshold of the device hardware during normal operation, such as the number of fans, power supplies, sensors, monitoring thresholds, drive paths, default scanning cycles, and other information.

[0101] In this embodiment, the main process is started first, and the device hardware information stored in the memory of the white box switch at the specified position is read through the main process.

[0102] S12: Creating at least one corresponding monitoring sub-process according to the device hardware information through the monitoring main process.

[0103] In this embodiment, after the monitoring main process obtains the device hardware information, the device hardware information is parsed, and then a corresponding monitoring sub-process is created according to the device hardware information of each device hardware, and then a corresponding monitoring sub-process is set for each device hardware. In addition to sharing data, each sub-process does not interfere with each other, and the exit of one sub-process will not cause the cessation of other sub-processes.

[0104] In this embodiment, the steps of creating at least one corresponding monitoring sub-process according to the device hardware information by monitoring the main process include:

[0105] S12-1: Parse the device hardware information through the monitoring main process to obtain monitoring indicator data of at least one device hardware in the device.

[0106] In this embodiment, the monitoring indicator data refers to the parameters that need to be monitored for each device hardware and the corresponding thresholds.

[0107] In this embodiment, the device hardware information includes the parameters of each device hardware, the threshold values ​​of each parameter, etc. The main process parses the device hardware information to obtain the monitoring indicator data of each device hardware in the switch. At the same time, it can also parse the number of device hardware in the switch, and then determine how many monitoring sub-processes need to be created.

[0108] In this embodiment, the monitoring program is structurally divided into a monitoring main process and at least one monitoring sub-process. After the monitoring program is started, the main process is started first, and the device hardware information pre-stored in the memory is obtained by monitoring the main process, and then the number of device hardware of the switch, the data that needs to be monitored for each device hardware and the corresponding monitoring threshold are determined.

[0109] S12-2: Create the monitoring subprocess corresponding to the device hardware according to the monitoring indicator data of each device hardware.

[0110] In this embodiment, after parsing the monitoring indicator data of each device hardware in the switch, a monitoring sub-process corresponding to each device hardware is created based on the parsed monitoring indicator data. When creating, the corresponding code is called, and the code includes a function for creating the corresponding sub-process, thereby creating the corresponding sub-process.

[0111] In this embodiment, the step of creating the monitoring subprocess corresponding to the device hardware according to the monitoring indicator data of each device hardware includes:

[0112] S12-2-1: Determine the process type of the monitoring sub-process corresponding to the device hardware based on the monitoring indicator data of each device hardware.

[0113] In this embodiment, the device hardware types of the device hardware include sensors, fans, power supplies, optical modules, and single-shot read types.

[0114] In this embodiment, according to the monitoring indicator data of each device hardware, it is determined from the indicator data whether the monitoring subprocess corresponding to the device hardware is a sensor, a fan, an optical module or a single read type.

[0115] S12-2-2: According to the process type, call the corresponding sub-process function to create a monitoring sub-process corresponding to the device hardware.

[0116] In this embodiment, the creation code and function corresponding to each type of sub-process are different. According to the sub-process type corresponding to each device hardware, the corresponding sub-process function is called to create the monitoring sub-process corresponding to the device hardware.

[0117] In this embodiment, each device hardware monitoring subprocess will perform corresponding operations according to the device hardware type of the monitored device hardware, including reading driver node data, comparing with preset thresholds, judging abnormal data, recording alarms, and other operations.

[0118] In this embodiment, the monitoring subprocess functions and internal parameters of different devices are different and can be adjusted adaptively. The monitoring subprocesses of fans, power supplies, sensors, and optical modules all have different functions. The monitoring subprocess of sensors focuses on monitoring and recording values ​​only, and at the same time, focuses on monitoring values ​​that are strongly related to the speed adjustment of the fan. In addition to monitoring the fan speed, the monitoring subprocess corresponding to the fan also needs to control the fan speed according to various temperature sensors and fan status, and force the device to shut down when the temperature cannot be reduced. Power supply monitoring requires more sensors to monitor the input and output current, voltage, temperature, etc. Optical module monitoring needs to focus on continuously maintaining monitoring of the module plug-in status and needs to respond in a timely manner. Other monitoring subprocesses are information that only needs to be read once, including switch asset information, firmware version information, etc. The monitoring subprocess can exit directly after reading.

[0119] In this embodiment, the method further includes:

[0120] S12-2-3: Import the device hardware name, monitoring threshold, and scanning interval time of the device hardware into the monitoring sub-process.

[0121] In this embodiment, after the monitoring sub-process is created, the device hardware name, monitoring threshold, and scanning interval of the device hardware are imported into the created monitoring sub-process, thereby completing the creation of the monitoring sub-process.

[0122] refer to Figure 2 , Figure 2Schematic diagram of the monitoring program structure proposed in one embodiment of the present application. Figure 2 As shown, the main process creates at least one sub-process, sensor sub-process 1 is responsible for monitoring sensor 1, sensor sub-process 2 is responsible for monitoring sensor 2, fan sub-process 1 is responsible for monitoring fan 1, fan sub-process 2 is responsible for monitoring fan 2, power sub-process 1 is responsible for monitoring power supply 1, and power sub-process 2 is responsible for monitoring power supply 2.

[0123] S13: Monitor the operating status of the corresponding device hardware in the device through the at least one monitoring sub-process.

[0124] In this embodiment, after the monitoring subprocess is created, at least one monitoring subprocess is created to scan the device hardware every period and obtain data generated by the device hardware during operation, and the operation status of each device hardware in the switch is monitored respectively.

[0125] In this embodiment, the step of monitoring the operating status of each device hardware in the switch by at least one monitoring subprocess includes:

[0126] S13-1: For each piece of device hardware, at every preset time interval, the monitoring indicator data of the device hardware is obtained through the monitoring sub-process.

[0127] In this embodiment, when monitoring the corresponding device hardware, the monitoring subprocess of each device hardware scans the device hardware at every preset time period to obtain the monitoring index data of the device hardware.

[0128] For example, the monitoring sub-process corresponding to the power supply scans the power supply every 10 seconds to obtain the current, voltage, and temperature data of the power supply.

[0129] S13-2: Compare the monitoring indicator data with a preset monitoring threshold through the monitoring subprocess to obtain a comparison result.

[0130] In this embodiment, the preset monitoring threshold is a reasonable range of pre-set monitoring indicator data, such as the maximum temperature, the maximum fan speed, the maximum current and voltage, etc. If the pre-set monitoring threshold is exceeded, the entire system may fail.

[0131] In this embodiment, after acquiring the monitoring indicator data on the device hardware, the monitoring subprocess compares the acquired monitoring indicator data with a preset monitoring threshold to obtain a comparison result.

[0132] S13-3: Determine whether the device hardware is abnormal based on the comparison result.

[0133] In this embodiment, after obtaining the comparison result, it is determined whether the device hardware has an abnormality. When the comparison result is that the value of the monitoring index data is within the range specified by the monitoring threshold, for example, the obtained value of the fan speed is greater than the preset maximum speed, it is determined that the device hardware has an abnormality. When the comparison result is that the value of the monitoring index data is within the range specified by the monitoring threshold, it is determined that the device hardware has no abnormality and is in a normal operating state.

[0134] In this embodiment, the method further includes:

[0135] S13-4: When it is determined that the device hardware is abnormal, the corresponding abnormal data is recorded in the system log of the device.

[0136] In this embodiment, the system log of the switch is used to record data generated during the operation of the switch.

[0137] In this embodiment, when it is determined that the device hardware is abnormal, the corresponding abnormal data is recorded in the system log of the switch.

[0138] 13-5: Send the abnormal data to the shared database of the switch.

[0139] In this embodiment, the shared database of the switch is used to share data between various device hardware in the switch. The data to be shared is placed in the shared database. Each process in the switch can access the database and read the data in the database, and then determine whether the corresponding device hardware needs to be adjusted based on the read data.

[0140] S13-6: Report the abnormal data to the monitoring main process.

[0141] In this embodiment, after the monitoring sub-process monitors abnormal data, the abnormal data is reported to the monitoring main process. After receiving the abnormal data, the monitoring main process will try to restore the monitoring sub-process and make corresponding adjustments to the system according to the abnormal data.

[0142] S14: Monitoring the running status of the at least one monitoring sub-process through the monitoring main process.

[0143] In this embodiment, after creating at least one monitoring sub-process, the monitoring main process is responsible for monitoring the running status of at least one monitoring sub-process. The specific steps include:

[0144] S14-1: Receive the operating status data reported by each monitoring sub-process through the monitoring main process.

[0145] In this embodiment, the monitoring main process receives the running status data reported by each monitoring sub-process during the running of the monitoring sub-process.

[0146] S14-2: When the received running status data reported by the monitoring sub-process indicates that an abnormality has occurred in the monitoring sub-process, restart the monitoring sub-process.

[0147] In this embodiment, the monitoring main process reads the received running status data. When the running status data contains abnormal data, it indicates that the monitoring sub-process is abnormal. At this time, the monitoring sub-process is restarted.

[0148] S14-3: When the monitoring subprocess is successfully restarted, continue to monitor the running status of the monitoring subprocess.

[0149] In this embodiment, when the monitoring sub-process is successfully restarted, the running status of the monitoring sub-process continues to be monitored by the monitoring main process.

[0150] S14-4: When the number of restart failures of the monitoring subprocess reaches a preset restart number threshold, generate alarm information corresponding to the monitoring subprocess.

[0151] In this embodiment, when the number of restart failures of the monitoring subprocess reaches a preset restart number threshold, it means that the monitoring subprocess cannot solve the problem by restarting, and an alarm information corresponding to the monitoring subprocess is generated at this time.

[0152] In another embodiment of the present application, before acquiring the device hardware information stored in the memory of the device through the monitoring main process of the device, the method further includes:

[0153] S21: Acquire the device hardware information of each device hardware in the device.

[0154] In this embodiment, in order to decouple the time monitoring program code from the actual device hardware, the platform device hardware information that the device hardware monitoring program relies on when running is first collected. This information has been determined when the switch leaves the factory, such as the number of device hardware, the name, parameters, monitoring threshold, drive path, scanning cycle, etc. of each device hardware.

[0155] S22: Storing the device hardware information in a preset data format in the memory of the device.

[0156] In this embodiment, after collecting the device hardware information of the switch, the collected device hardware information is stored in the memory of the switch in a preset data format. When the switch is running, the device hardware information stored in the memory of the switch is read by the main process of the monitoring program.

[0157] In another embodiment of the present application, the method further includes:

[0158] S31: For each monitoring subprocess, when abnormal data is detected in the corresponding device hardware, shorten the scanning time interval for the device hardware, and / or adjust the monitoring threshold corresponding to the device hardware.

[0159] In this embodiment, for each monitoring sub-process, when abnormal data is detected in the corresponding device hardware, the scanning time of the device hardware is shortened to obtain the operating status data of the device hardware more quickly, and at the same time, the monitoring threshold corresponding to the device hardware is lowered to ensure that no major failures occur in the device hardware.

[0160] In this embodiment, for the device hardware monitored by a certain monitoring sub-process, the frequency of abnormalities occurring is different, so each sub-process can automatically adjust the monitoring time interval and the monitoring threshold according to the frequency of abnormalities occurring.

[0161] For example, when it is monitored that the rotation speed of the fan exceeds a preset rotation speed threshold, the scanning time interval of the fan is shortened from 10 seconds to 5 seconds, and the rotation speed threshold of the fan is appropriately lowered.

[0162] S32: Furthermore, when it is monitored within a preset time period that the values ​​of the operating status data of the device hardware are all within the range specified by the monitoring threshold, the normal scanning time interval and / or the monitoring threshold corresponding to the device hardware is restored.

[0163] In this embodiment, after shortening the scanning cycle, a time period is preset. When the operating status data of the device hardware is monitored to be normal within the preset time period, that is, when the operating status data of the device hardware is monitored to be within the range specified by the monitoring threshold, the scanning time interval of the device hardware is restored to the normal scanning time interval.

[0164] In this embodiment, if the operating status data of the device hardware remains normal for a long time, in order to save system resources, the scanning time interval for the device hardware can be increased, and the preset monitoring threshold is maintained unchanged.

[0165] In this embodiment, each monitoring subprocess can adaptively adjust the monitoring time interval, monitoring threshold and other parameters according to the monitored data, and can flexibly monitor the hardware of each device, ensuring the rational use of system resources and improving the monitoring efficiency of each monitoring subprocess.

[0166] In another embodiment of the present application, the method further includes:

[0167] S41: Storing the running status data monitored by the monitoring subprocess into a shared database of the device.

[0168] In this embodiment, each monitoring sub-process stores the monitored running status data in a shared database of the switch, so that other sub-processes can share the data.

[0169] S42: The monitoring subprocess obtains the running status data corresponding to the monitoring subprocess of the same type from the shared database.

[0170] In this embodiment, each monitoring subprocess can obtain running status data from the shared database. The same type of monitoring subprocesses often need to share running status data. Each monitoring subprocess can search the shared database for the same type of monitoring subprocess to send the running status data.

[0171] S43: The monitoring subprocess adjusts the monitoring strategy according to the running status data.

[0172] In this embodiment, each monitoring subprocess adjusts its own monitoring strategy according to the acquired running status data, such as shortening the scanning cycle of the device hardware, adjusting the monitoring threshold, etc.

[0173] In this embodiment, the monitoring subprocess adjusts the monitoring strategy according to the running status data, including:

[0174] S43-1: According to the running status data, adjust the scanning time interval of the monitoring subprocess on the device hardware, and adjust the monitoring threshold corresponding to the device hardware.

[0175] In this embodiment, when the running status data corresponding to the same type of sub-process is obtained, in order to ensure the normal operation of each device hardware in the switch, the monitoring sub-process will also adjust its own scanning time interval for the device hardware and adjust the corresponding monitoring threshold of the device hardware according to the obtained running status data. For example, when the running status data of the same type of sub-process is abnormal, the sub-process will also shorten the scanning time interval for the device hardware and lower the corresponding monitoring threshold of the device hardware.

[0176] In this embodiment, each monitoring subprocess can exchange the operating status information of the device hardware monitored by each of them through a shared database. When a certain type of monitoring subprocess monitors an abnormality, other subprocesses of the same type will also perform operations including reducing the scanning time interval and reducing the threshold. The above method realizes the adaptive and flexible monitoring strategy regulation between each subprocess, and arranges the resource allocation of the system more reasonably. The data can also be put into the sysfs file through the sysfs node method, and the monitored operating status data can be synchronized with each other through the file method.

[0177] refer to Figure 3 , Figure 3: is a schematic diagram of the monitoring process operation flow proposed in an embodiment of the present application, such as Figure 3 As shown, at the beginning of the process, the device hardware information of the switch is first read from the memory at the specified location, and the content therein is parsed, and the parsed memory is stored in the memory, and a corresponding sub-process is created and started according to the parsed content, and then the running status of the sub-process is monitored by the main process. When a sub-process fails, the sub-process is restarted and restored by the main process.

[0178] In another embodiment of the present application, a monitoring process is proposed based on a typical white box switch network operating system.

[0179] For example, the device hardware monitoring program of the white box switch uses Python, the database uses redis, and the switch comes with an EEPROM to store device hardware information. The storage format of the device hardware information is as follows:

[0180] "sensor":{

[0181] "num": 5,

[0182] "sensor1": {

[0183] “path”: “aaa / bbb”

[0184] "time_delay": 10,

[0185] "thersholds": [

[0186] 5, 10, 65, 70 ]

[0188] }

[0189] …

[0190] }

[0191] …

[0192] It includes the type, quantity, names, scanning time intervals, and monitoring thresholds of the equipment hardware that needs to be monitored. If the equipment hardware is more complex, such as the fan control program, it is also necessary to include the name of the dependent temperature sensor, the type of control strategy, related control parameters and other information.

[0193] In this embodiment, after the main process of the monitoring program is started, it first reads and parses the contents in the memory and caches them in its own memory space. After the parsing is completed, a child process is created based on the parsed information. The creation of the child process can use Python's thread library operation, which contains creation functions for various types of monitoring child processes. After the child process is successfully created, the work of the main process is transformed into the running status of the monitoring child process. If a child process is found to be abnormal, an attempt is made to restore the abnormal child process until the recovery is successful or the number of retries is exceeded.

[0194] In this embodiment, the monitoring program code contains five types of sub-processes: sensor, power supply, fan, optical module, and single reading. When a sub-process of a certain type needs to be created, the corresponding code is called. When creating, the necessary information such as the device hardware name, monitoring threshold, and scanning interval are imported into the sub-process. Each device hardware that needs to be monitored is monitored using a monitoring sub-process. At this time, there are 5 sensors in the switch, so 5 sub-processes are created. For example, sensor sensor1 is monitored using a sub-process named sensor1. The sub-process is only responsible for the relevant operations of the sensor and does not participate in other operations. The policy control of each sub-process can be set by itself. The data communication between each monitoring sub-process is realized through the database. For example, the monitoring sub-process corresponding to the fan reads the data in the database to control the fan.

[0195] In this embodiment, reference Figure 4 , Figure 4 : is a schematic diagram of the monitoring sub-process control flow proposed in an embodiment of the present application, such as Figure 4 As shown, the monitoring subprocess obtains information such as the device hardware name, monitoring interval, and monitoring threshold from the main process. When a subprocess monitors a device hardware anomaly once, when the device hardware returns to normal, the time interval for each round of scanning is reduced, and so on, until the interval reaches the shortest. If no anomaly is found again within a period of time, the scanning time interval is extended until the scanning time interval returns to normal. If the same type of subprocess detects an anomaly, the anomaly information will be pushed to the database to inform other subprocesses. Other subprocesses of the same type will also adjust the scanning time interval for the device hardware, for example, it can be reduced by 1 second, and the monitoring threshold can also be appropriately reduced or increased.

[0196] In another embodiment of the present application, device hardware of the same type can be regarded as a device hardware group, and a monitoring sub-process is created for the device hardware group. The monitoring sub-process periodically scans each device hardware in the same device hardware group and reports the monitored operating status data to the main process. Each process group is independent of each other, and the operating status data within each device hardware group is interoperable. When adjusting the monitoring strategy, the monitoring strategy corresponding to each device hardware in the group can be adjusted based on the group. This can ensure that the monitoring sub-processes between different types of device hardware are independent of each other and do not affect each other, and can speed up the adjustment of the monitoring strategy for the same type of device hardware.

[0197] In the above embodiments of the present application, by recording the device hardware information in the white box switch in the memory, the device hardware monitoring program can realize the adaptive configuration on the platform without relying on the platform re-encoding, thereby improving the work efficiency of the platform. A corresponding monitoring sub-process is created for each device hardware, and no overall monitoring is performed, thereby improving the efficiency and accuracy of monitoring. The form of a main process monitoring at least one sub-process is adopted to improve the reliability of monitoring. If a separate sub-process exits, it will not affect the work of other processes. At the same time, the main process can try to restore the abnormal sub-process, further improving the stability of system operation. During operation, the monitoring sub-process can also appropriately adjust the monitoring cycle and monitoring threshold according to the working conditions of the device hardware it monitors. At the same time, it can also further adjust the monitoring strategy according to the abnormal conditions reported by the same type of monitoring sub-process, thereby achieving the flexibility and accuracy of monitoring, reducing resource consumption, and improving the overall work efficiency of the system.

[0198] Based on the same inventive concept, an embodiment of the present application provides a device monitoring apparatus. Figure 5 , Figure 5 FIG. 5 is a schematic diagram of a device monitoring apparatus 500 proposed in an embodiment of the present application. Figure 5 As shown, the device comprises:

[0199] The device hardware information acquisition module 501 is used to acquire the device hardware information stored in the memory of the device through the monitoring main process of the device;

[0200] A monitoring sub-process creation module 502, configured to create at least one corresponding monitoring sub-process according to the device hardware information through the monitoring main process;

[0201] A first monitoring module 503, configured to monitor the operating status of the corresponding device hardware in the device through the at least one monitoring subprocess;

[0202] The second monitoring module 504 is used to monitor the running status of the at least one monitoring sub-process through the monitoring main process.

[0203] Optionally, the device further comprises:

[0204] A device hardware information collection module, used to obtain the device hardware information of each device hardware in the device;

[0205] The device hardware information storage module is used to store the device hardware information in the memory of the device in a preset data format.

[0206] Optionally, the monitoring subprocess creation module includes:

[0207] An information parsing submodule, used to parse the device hardware information through the monitoring main process to obtain monitoring indicator data of at least one device hardware in the device;

[0208] The monitoring sub-process creation sub-module is used to create the monitoring sub-process corresponding to the device hardware according to the monitoring indicator data of each device hardware.

[0209] Optionally, the monitoring subprocess creation submodule includes:

[0210] A process type determination submodule, used to determine the process type of the monitoring subprocess corresponding to the device hardware according to the monitoring indicator data of each device hardware;

[0211] The function calling submodule is used to call the corresponding subprocess function according to the process type and create a monitoring subprocess corresponding to the device hardware.

[0212] Optionally, the device further comprises:

[0213] The data import submodule is used to import the device hardware name, monitoring threshold, and scanning interval time of the device hardware into the monitoring subprocess.

[0214] Optionally, the first monitoring module includes:

[0215] A data acquisition submodule, used for acquiring monitoring index data of each device hardware through the monitoring subprocess at a preset time interval;

[0216] A data comparison submodule, used to compare the monitoring indicator data with a preset monitoring threshold through the monitoring subprocess to obtain a comparison result;

[0217] The abnormality determination submodule is used to determine whether an abnormality occurs in the device hardware according to the comparison result.

[0218] Optionally, the device further comprises:

[0219] A data recording submodule, for recording corresponding abnormal data in a system log of the device when it is determined that the device hardware is abnormal;

[0220] A data sharing submodule, used for sending the abnormal data to a shared database of the device;

[0221] The abnormality reporting submodule is used to report the abnormal data to the monitoring main process.

[0222] Optionally, the second monitoring module includes:

[0223] A data receiving submodule, used for receiving the running status data reported by each monitoring subprocess through the monitoring main process;

[0224] The monitoring subprocess restart submodule is used to restart the monitoring subprocess when receiving the running status data reported by the monitoring subprocess indicating that the monitoring subprocess is abnormal;

[0225] A monitoring continuation submodule, used for continuing to monitor the running status of the monitoring subprocess when the monitoring subprocess is successfully restarted;

[0226] The alarm information generation submodule is used to generate alarm information corresponding to the monitoring subprocess when the number of restart failures of the monitoring subprocess reaches a preset restart number threshold.

[0227] Optionally, the device further comprises:

[0228] A first monitoring strategy adjustment module is used for shortening the scanning time interval of the device hardware and / or adjusting the monitoring threshold corresponding to the device hardware for each of the monitoring subprocesses when abnormal data of the corresponding device hardware is monitored;

[0229] The monitoring strategy recovery module is used to restore the normal scanning time interval and / or the monitoring threshold corresponding to the device hardware when the values ​​of the operating status data of the device hardware are monitored within the range specified by the monitoring threshold within a preset time period.

[0230] Optionally, the device further comprises:

[0231] The second monitoring strategy adjustment module is used to increase the scanning time interval of the device hardware and / or adjust the monitoring threshold corresponding to the device hardware when no abnormal data is detected in the device hardware within a preset time period.

[0232] Optionally, the device further comprises:

[0233] A data sharing module, used for storing the running status data monitored by the monitoring subprocess into a shared database of the device;

[0234] A data acquisition module, used for the monitoring subprocess to acquire the running status data corresponding to the monitoring subprocess of the same type from the shared database;

[0235] The third strategy adjustment module is used for the monitoring subprocess to adjust the monitoring strategy according to the running status data.

[0236] Optionally, the third policy adjustment module includes:

[0237] The monitoring strategy adjustment submodule is used to adjust the scanning time interval of the monitoring subprocess for the corresponding device hardware according to the running status data, and to adjust the monitoring threshold corresponding to the device hardware.

[0238] Based on the same inventive concept, another embodiment of the present application provides a readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the method described in any of the above embodiments of the present application.

[0239] Based on the same inventive concept, another embodiment of the present application provides an electronic device, Figure 6 It is a schematic diagram of an electronic device 600 proposed in one embodiment of the present application, including a memory 602, a processor 601 and a computer program stored in the memory and executable on the processor, wherein when the processor is executed, the steps in the dual-site data storage method described in any of the above embodiments of the present application are implemented.

[0240] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0241] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0242] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present application may take the form of complete device hardware embodiments, complete software embodiments, or embodiments in combination with software and device hardware. Moreover, the embodiments of the present application may take the form of a computer program product implemented on one or at least one computer-usable storage medium (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0243] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or at least one process and / or box Figure 1 A device that is a block or at least a function specified in a block.

[0244] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or at least one process and / or box Figure 1 boxes or at least the functions specified in a box.

[0245] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or at least one process and / or box Figure 1 A block or at least a step of the function specified in a block.

[0246] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.

[0247] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0248] The equipment monitoring method, device, equipment and storage medium provided by the present application are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A device monitoring method, characterized in that: The method comprises: Acquire the device hardware information stored in the memory of the device through the monitoring main process of the device; Determine the hardware quantity, monitoring parameters and thresholds of the device according to the device hardware information through the monitoring main process, and create at least one monitoring sub-process of the corresponding quantity; By means of the at least one monitoring subprocess, the operating status of the corresponding device hardware in the device is monitored respectively; Monitoring the running status of the at least one monitoring sub-process through the monitoring main process; Storing the running status data monitored by the monitoring subprocess in a shared database of the device; The monitoring subprocess obtains the running status data corresponding to the monitoring subprocess of the same type from the shared database; The monitoring subprocess adjusts the monitoring strategy according to the running status data.

2. The device monitoring method according to claim 1, characterized in that: Before acquiring the device hardware information stored in the memory of the device through the monitoring main process of the device, the method further includes: Obtaining the device hardware information of each device hardware in the device; The device hardware information is stored in the memory of the device in a preset data format.

3. The device monitoring method according to claim 1, characterized in that: The step of creating at least one corresponding monitoring sub-process according to the device hardware information through the monitoring main process includes: Parsing the device hardware information through the monitoring main process to obtain monitoring indicator data of at least one device hardware in the device; According to the monitoring indicator data of each device hardware, the monitoring subprocess corresponding to the device hardware is created.

4. The device monitoring method according to claim 3, characterized in that: The step of creating the monitoring subprocess corresponding to the device hardware according to the monitoring indicator data of each device hardware includes: Determine the process type of the monitoring subprocess corresponding to the device hardware according to the monitoring indicator data of each device hardware; According to the process type, the corresponding sub-process function is called to create a monitoring sub-process corresponding to the device hardware.

5. The device monitoring method according to claim 4, characterized in that: The method further comprises: The device hardware name, monitoring threshold, and scanning interval of the device hardware are imported into the monitoring subprocess.

6. The device monitoring method according to claim 1, characterized in that: The step of monitoring the operation status of the corresponding device hardware in the device through the at least one monitoring subprocess includes: For each of the device hardware, at every preset time interval, the monitoring indicator data of the device hardware is obtained through the monitoring subprocess; The monitoring indicator data is compared with a preset monitoring threshold value through the monitoring subprocess to obtain a comparison result; According to the comparison result, it is determined whether the device hardware is abnormal.

7. The device monitoring method according to claim 6, characterized in that: The method further comprises: When it is determined that the hardware of the device is abnormal, the corresponding abnormal data is recorded in the system log of the device; sending the abnormal data to a shared database of the device; The abnormal data is reported to the monitoring main process.

8. The device monitoring method according to claim 1, characterized in that: The monitoring the running status of the at least one monitoring sub-process by the monitoring main process includes: Receiving, through the monitoring main process, the running status data reported by each of the monitoring sub-processes; When receiving the running status data reported by the monitoring subprocess indicating that the monitoring subprocess is abnormal, restarting the monitoring subprocess; When the monitoring subprocess is successfully restarted, continue to monitor the running status of the monitoring subprocess; When the number of restart failures of the monitoring subprocess reaches a preset restart number threshold, an alarm message corresponding to the monitoring subprocess is generated.

9. The device monitoring method according to claim 1, characterized in that: The method further comprises: For each of the monitoring subprocesses, when abnormal data is detected in the corresponding device hardware, a scanning time interval for the device hardware is shortened, and / or a monitoring threshold corresponding to the device hardware is adjusted; Furthermore, when it is monitored within a preset time period that the values ​​of the operating status data of the device hardware are all within the range specified by the monitoring threshold, the normal scanning time interval and / or the monitoring threshold corresponding to the device hardware are restored.

10. The device monitoring method according to claim 9, characterized in that: The method further comprises: When no abnormal data is detected in the device hardware within a preset time period, the scanning time interval for the device hardware is increased, and / or the monitoring threshold corresponding to the device hardware is adjusted.

11. The device monitoring method according to claim 10, characterized in that: The monitoring subprocess adjusts the monitoring strategy according to the running status data, including: The monitoring subprocess adjusts a scanning time interval of the monitoring subprocess for the corresponding device hardware according to the running status data, and adjusts a monitoring threshold corresponding to the corresponding device hardware.

12. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps in the method according to any one of claims 1 to 11 are implemented.

13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps in the method according to any one of claims 1 to 11 are implemented.

14. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 11 are implemented.

Citation Information

Patent Citations

  • Network equipment exception handling method and device, storage medium and network equipment

    CN111682977A

  • Process monitoring method and system, terminal and storage medium

    CN111913851A