CN117971612A - Hard disk monitoring method, device, equipment and medium - Google Patents

Hard disk monitoring method, device, equipment and medium Download PDF

Info

Publication number
CN117971612A
CN117971612A CN202410382656.8A CN202410382656A CN117971612A CN 117971612 A CN117971612 A CN 117971612A CN 202410382656 A CN202410382656 A CN 202410382656A CN 117971612 A CN117971612 A CN 117971612A
Authority
CN
China
Prior art keywords
hard disk
compression algorithm
target
compression
text
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.)
Granted
Application number
CN202410382656.8A
Other languages
Chinese (zh)
Other versions
CN117971612B (en
Inventor
王云
李金锋
王兴隆
林金芸
朱保彬
刘宝阳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Metabrain Intelligent Technology Co Ltd
Original Assignee
Suzhou Metabrain 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 Metabrain Intelligent Technology Co Ltd filed Critical Suzhou Metabrain Intelligent Technology Co Ltd
Priority to CN202410382656.8A priority Critical patent/CN117971612B/en
Publication of CN117971612A publication Critical patent/CN117971612A/en
Application granted granted Critical
Publication of CN117971612B publication Critical patent/CN117971612B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The application discloses a hard disk monitoring method, a device, equipment and a medium, which relate to the technical field of hard disk monitoring and are applied to a substrate management controller and comprise the following steps: obtaining a compressed data packet corresponding to hard disk log data of a monitored hard disk; the compressed data packet is a data packet obtained by compressing hard disk log data based on a preset hybrid compression algorithm; acquiring compression information corresponding to the compressed data packet; the compression information comprises a target compression algorithm and target parameters, wherein the target compression algorithm is at least one compression algorithm in a preset mixed compression algorithm, and the target parameters are parameters generated in the process of compressing the hard disk log data by using the target compression algorithm; and decompressing the compressed data packet by using a decompression algorithm determined based on the compressed information to obtain hard disk log data so as to monitor the monitored hard disk. According to the application, the hard disk log data is compressed by adopting a preset hybrid compression algorithm and then transmitted, so that the monitored hard disk can transmit more hard disk log data in a shorter time.

Description

Hard disk monitoring method, device, equipment and medium
Technical Field
The present invention relates to the field of hard disk monitoring technologies, and in particular, to a method, an apparatus, a device, and a medium for hard disk monitoring.
Background
The hard disk is one of the most important storage devices of a computer, and thus, healthy operation of the hard disk is one of the key factors for guaranteeing the reliability of a device server.
In order to ensure accurate control of the operation state of the hard disk, equipment is required to monitor in the operation process of the hard disk so as to acquire the health state data of the hard disk. In the hard disk out-of-band monitoring scheme, health status data transmitted by the hard disk is generally obtained by a baseboard management controller and presented to an operation and maintenance person. However, as the health status data of the hard disk increases, the time for transmitting the data also increases greatly, which also makes the data transmission speed and efficiency lower and lower.
In summary, how to improve the speed and efficiency of the data transmission from the hard disk to the outside in the out-of-band monitoring of the hard disk is a technical problem that needs to be solved by those skilled in the art.
Disclosure of Invention
Accordingly, the present invention is directed to a method, apparatus, device and medium for monitoring a hard disk, which can improve the speed and efficiency of data transmission from the hard disk to the outside in the out-of-band monitoring of the hard disk. The specific scheme is as follows:
in a first aspect, the present application discloses a method for monitoring a hard disk, which is applied to a baseboard management controller, and includes:
Obtaining a compressed data packet corresponding to hard disk log data of a monitored hard disk; the compressed data packet is a data packet obtained by compressing the hard disk log data based on a preset hybrid compression algorithm;
Acquiring compression information corresponding to the compression data packet; the compression information comprises a target compression algorithm and target parameters, wherein the target compression algorithm is at least one compression algorithm in the preset hybrid compression algorithm, and the target parameters are parameters generated in the process of compressing the hard disk log data by using the target compression algorithm;
And determining a corresponding decompression algorithm based on the compression information, and decompressing the compression data packet by using the decompression algorithm to obtain the hard disk log data so as to monitor the monitored hard disk based on the hard disk log data.
Optionally, the target compression algorithm is a first compression algorithm in the preset hybrid compression algorithm; the first compression algorithm is used for performing text matching on the current stored data and the historical stored data in the constructed hash table so as to output unmatched text and a target binary sequence according to a text matching result.
Optionally, the process of compressing the hard disk log data by using the target compression algorithm includes:
constructing the hash table and dividing the hard disk log data into at least one character string;
And sequentially storing the at least one character string into the hash table based on the first compression algorithm until the last character string is stored into the hash table, and outputting a corresponding unmatched text and a target tuple sequence to obtain the compressed data packet based on the unmatched text and the target tuple sequence.
Optionally, the process of sequentially storing the at least one character string into the hash table based on the first compression algorithm includes:
judging whether a text match exists between a first character string which is currently stored and a history character string which is already stored in the hash table;
if the first character string and the history character string are not matched in text, storing the first character string into a preset unmatched text; if a second character string is matched with the first character string in the history character strings, confirming the text matching length, and judging whether the text matching length exceeds a first preset threshold value or not;
If the text matching length does not exceed the first preset threshold value, storing the first character string into the unmatched text; if the text matching length exceeds the first preset threshold, outputting a corresponding target binary group sequence, and storing characters, which are not matched with the second character string, in the first character string into the unmatched text; wherein; the target tuple sequence includes the text matching length and an initial character position of the second string.
Optionally, the preset hybrid compression algorithm further includes a second compression algorithm and a third compression algorithm;
correspondingly, the process of compressing the hard disk log data based on the preset hybrid compression algorithm comprises the following steps:
when the size of the hard disk log data meets a second preset threshold value, compressing the hard disk log data by using the first compression algorithm to output a corresponding unmatched text and a target binary group sequence;
determining the repetition times of each character in the unmatched text to determine the maximum repetition times, and compressing the unmatched text by using the second compression algorithm and/or the third compression algorithm to obtain first compression data under the condition that the maximum repetition times are different from the total text length of the unmatched text;
Under the condition that the values of the sequences in the target binary group sequence are not the same values, the third compression algorithm is utilized to compress the target binary group sequence to obtain second compressed data;
And obtaining the compressed data packet based on the first compressed data and the second compressed data, and recording the compression algorithm used this time to obtain the target compression algorithm.
Optionally, when the maximum repetition number is different from the total text length of the unmatched text, compressing the unmatched text by using the second compression algorithm and/or the third compression algorithm to obtain first compressed data, including:
judging whether the maximum repetition number and the text total length meet a preset condition or not under the condition that the maximum repetition number and the text total length of the unmatched text are different;
If the maximum repetition number and the total text length meet the preset conditions, compressing the unmatched text by using the second compression algorithm to obtain initial compressed data, and then compressing the initial compressed data by using the third compression algorithm to obtain first compressed data;
And if the maximum repetition number and the total text length do not meet the preset conditions, compressing the unmatched text by using the third compression algorithm to obtain first compressed data.
Optionally, the determining whether the maximum repetition number and the total text length meet a preset condition includes:
judging whether the maximum repetition number is smaller than or equal to the sum of the total text length and a preset non-zero numerical value;
And if the maximum repetition number is smaller than or equal to the sum of the total text length and a preset non-zero value, judging that the maximum repetition number and the total text length meet the preset condition, otherwise, judging that the maximum repetition number and the total text length do not meet the preset condition.
Optionally, the hard disk monitoring method further includes:
If the maximum repetition number is the same as the total text length, directly outputting text tuple information and taking the text tuple information as the target parameter, and then prohibiting the step of compressing the unmatched text by using the second compression algorithm and/or the third compression algorithm to obtain first compressed data; wherein the text tuple information includes character information of the unmatched text and the total text length.
Optionally, the hard disk monitoring method further includes:
If the values of the sequences in the target binary sequence are the same, directly outputting numerical information and the number of the binary groups, taking the numerical information and the number of the binary groups as the target parameters, and prohibiting the step of compressing the target binary sequence by using the third compression algorithm to obtain second compressed data.
Optionally, before compressing the target tuple sequence by using the third compression algorithm to obtain second compressed data, the method further includes:
Acquiring a historical binary sequence, and judging whether a binary sequence identical to the target binary sequence exists in the historical binary sequence;
if the data exists, the historical compressed data corresponding to the same binary group sequence is directly copied to be used as second compressed data.
Optionally, the compressing the target tuple sequence by using the third compression algorithm to obtain second compressed data includes:
Normalizing the target binary sequence to obtain a processed binary sequence;
and compressing the processed binary sequence by using the third compression algorithm to obtain second compressed data.
Optionally, the hard disk monitoring method further includes:
After the server is powered on and started, a preset system starting controller is utilized to send a target command to the monitored hard disk; the target command is used for controlling the monitored hard disk to send a preset number of data packets with target sizes to the baseboard management controller;
And counting the average compression time and the average decompression time of the data packets with the preset number of target sizes by the system starting controller, and determining a larger value from the average compression time and the average decompression time so as to set the frequency parameter of the monitored hard disk output hard disk log data by using the larger value.
Optionally, the baseboard management controller is connected with a hard disk pin of the monitored hard disk through a first signal line;
correspondingly, the obtaining the compressed data packet corresponding to the hard disk log data of the monitored hard disk includes:
Acquiring a first output signal of the hard disk pin through the first signal line; the first output signal is a signal obtained by compressing hard disk log data of the monitored hard disk based on a preset hybrid compression algorithm to obtain a compressed data packet, and modulating an initial output signal of the hard disk pin according to the compressed data packet;
Demodulating the first output signal to obtain the compressed data packet.
Optionally, the baseboard management controller is connected with a complex programmable logic device through a second signal line, and the complex programmable logic device is connected with a hard disk pin of the monitored hard disk through a third signal line;
correspondingly, the obtaining the compressed data packet corresponding to the hard disk log data of the monitored hard disk includes:
Obtaining a compressed data packet which is obtained after the complex programmable logic device demodulates the second output signal of the hard disk pin and is sent through the second signal line; the complex programmable logic device obtains a second output signal of the hard disk pin by using the third signal line, wherein the second output signal is a signal obtained by compressing hard disk log data of the monitored hard disk based on a preset hybrid compression algorithm to obtain a compressed data packet, and modulating an initial output signal of the hard disk pin according to the compressed data packet.
Optionally, the baseboard management controller is connected with a complex programmable logic device through a second signal line, and the complex programmable logic device is connected with a hard disk pin of the monitored hard disk through a third signal line;
correspondingly, the obtaining the compressed data packet corresponding to the hard disk log data of the monitored hard disk includes:
Obtaining a compressed data packet which is obtained after the complex programmable logic device compresses hard disk log data by using a preset hybrid compression algorithm and is sent through the second signal line; the complex programmable logic device obtains a third output signal of the hard disk pin by using the third signal wire, demodulates the third output signal to obtain the hard disk log data, and the third output signal is a signal obtained after the monitored hard disk modulates the initial output signal of the hard disk pin according to the hard disk log data.
In a second aspect, the present application discloses a method for monitoring a hard disk, which is applied to a monitored hard disk, and includes:
Compressing hard disk log data based on a preset hybrid compression algorithm to obtain a compressed data packet, and sending the compressed data packet to a baseboard management controller;
determining compression information corresponding to the compressed data packet; the compression information comprises a target compression algorithm and target parameters, wherein the target compression algorithm is at least one compression algorithm in the preset hybrid compression algorithm, and the target parameters are parameters generated in the process of compressing the hard disk log data by using the target compression algorithm;
And sending the compressed information to a baseboard management controller so that the baseboard management controller determines a corresponding decompression algorithm based on the compressed information, and decompressing the compressed data packet by using the decompression algorithm to obtain the hard disk log data so as to monitor the monitored hard disk based on the hard disk log data.
In a third aspect, the present application discloses a hard disk monitoring device, applied to a baseboard management controller, comprising:
The compressed data acquisition module is used for acquiring compressed data packets corresponding to the hard disk log data of the monitored hard disk; the compressed data packet is a data packet obtained by compressing the hard disk log data based on a preset hybrid compression algorithm;
the information reading module is used for acquiring compression information corresponding to the compression data packet; the compression information comprises a target compression algorithm and target parameters, wherein the target compression algorithm is at least one compression algorithm in the preset hybrid compression algorithm, and the target parameters are parameters generated in the process of compressing the hard disk log data by using the target compression algorithm;
And the decompression module is used for determining a corresponding decompression algorithm based on the compression information, and decompressing the compression data packet by using the decompression algorithm to obtain the hard disk log data so as to monitor the monitored hard disk based on the hard disk log data.
In a fourth aspect, the present application discloses a hard disk monitoring device, applied to a monitored hard disk, comprising:
The data compression module is used for compressing the hard disk log data based on a preset hybrid compression algorithm to obtain a compressed data packet, and sending the compressed data packet to the baseboard management controller;
The information determining module is used for determining compression information corresponding to the compression data packet; the compression information comprises a target compression algorithm and target parameters, wherein the target compression algorithm is at least one compression algorithm in the preset hybrid compression algorithm, and the target parameters are parameters generated in the process of compressing the hard disk log data by using the target compression algorithm;
And the information sending module is used for sending the compressed information to a baseboard management controller so that the baseboard management controller can determine a corresponding decompression algorithm based on the compressed information, and decompress the compressed data packet by using the decompression algorithm to obtain the hard disk log data so as to monitor the monitored hard disk based on the hard disk log data.
In a fifth aspect, the present application discloses an electronic device, comprising:
A memory for storing a computer program;
And a processor for executing the computer program to implement the steps of the hard disk monitoring method disclosed above.
In a sixth aspect, the present application discloses a computer readable storage medium for storing a computer program; wherein the computer program when executed by a processor implements the steps of the hard disk monitoring method disclosed above.
Therefore, the compressed data packet corresponding to the hard disk log data of the monitored hard disk is obtained through the baseboard management controller; the compressed data packet is a data packet obtained by compressing the hard disk log data based on a preset hybrid compression algorithm; acquiring compression information corresponding to the compression data packet; the compression information comprises a target compression algorithm and target parameters, wherein the target compression algorithm is at least one compression algorithm in the preset hybrid compression algorithm, and the target parameters are parameters generated in the process of compressing the hard disk log data by using the target compression algorithm; and determining a corresponding decompression algorithm based on the compression information, and decompressing the compression data packet by using the decompression algorithm to obtain the hard disk log data so as to monitor the monitored hard disk based on the hard disk log data.
The application has the beneficial effects that: in the application, the compressed data packet corresponding to the hard disk log data of the monitored hard disk is obtained by the baseboard management controller, namely the data packet which is transmitted after the hard disk log data of the monitored hard disk is compressed, so that the speed and the efficiency of transmitting the data outwards of the hard disk are improved through data compression. When the data compression is executed, the method specifically adopts the preset hybrid compression algorithm to compress the hard disk log data so as to further improve the data compression efficiency, so that the monitored hard disk can transmit more hard disk log data in a shorter time, and for the condition of different data packets, the method does not need to compress the data by using all compression algorithms in the preset hybrid compression algorithm, but can pertinently execute corresponding compression steps on different hard disk log data by using a target compression algorithm, wherein the target compression algorithm is at least one compression algorithm in the preset hybrid compression algorithm. And finally, when the baseboard management controller decompresses the compressed data packet, the baseboard management controller can rapidly determine a corresponding decompression algorithm according to the compressed information, so that the decompression efficiency of the compressed data packet can be improved, and the out-of-band monitoring of the monitored hard disk is realized based on the hard disk log data obtained by decompression. Through the scheme, the application also realizes high-efficiency and reliable out-of-band monitoring on the basis of improving the efficiency of transmitting the hard disk log data by the hard disk.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present application, and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a conventional hard disk out-of-band monitoring system according to the present application;
FIG. 2 is a flow chart of a method for monitoring a hard disk according to the present application;
FIG. 3 is a flowchart of a specific method for monitoring a hard disk according to the present application;
FIG. 4 is a schematic diagram of a hard disk log data loading hash table according to the present disclosure;
FIG. 5 is a flow chart of a method for compressing data using a hybrid compression algorithm in accordance with the present disclosure;
FIG. 6 is a flow chart illustrating the execution of a hybrid compression algorithm according to the present disclosure;
FIG. 7 is a flow chart of a method for decompressing data according to the present disclosure;
FIG. 8 is a schematic diagram of a particular hard disk monitoring system according to the present disclosure;
FIG. 9 is a flowchart of another method for monitoring a hard disk according to the present application;
FIG. 10 is a schematic diagram of a hard disk monitoring device according to the present application;
FIG. 11 is a schematic diagram of another embodiment of a hard disk monitoring device according to the present application;
Fig. 12 is a block diagram of an electronic device according to the present disclosure.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but 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.
In the hard disk out-of-band monitoring scheme, health status data transmitted by the hard disk is generally obtained by a baseboard management controller and presented to an operation and maintenance person. However, as the health status data of the hard disk increases, the time for transmitting the data also increases greatly, which also makes the data transmission speed and efficiency lower and lower. Therefore, the embodiment of the application discloses a method, a device, equipment and a medium for monitoring a hard disk, which can improve the speed and efficiency of outward data transmission of the hard disk in out-of-band monitoring of the hard disk.
For ease of understanding, the description will first be made of the content related to the hard disk out-of-band monitoring scheme.
Out-of-band management means that network management is realized through a special network management channel, network management data and service data are separated, and an independent channel is established for the network management data. In the channel, only the management data is transmitted, and the network management data is separated from the service data, so that the efficiency and the reliability of the network management can be improved, and the safety of the network management data can be improved. After deployment, the server provides out-of-band management and monitoring functions through a baseboard management controller (baseboard management controller, BMC).
The baseboard management controller is one of the important devices of the out-of-band management system. The baseboard management controller is a specialized service processor that uses sensors to monitor the status of a computer, web server, or other hardware driven device and communicates with the system administrator of the device via separate connection lines. In actual use, the baseboard management controller is typically mounted on a motherboard or main circuit board of a monitored device, and the baseboard management controller's sensors are used to measure internal physical variables such as: temperature, humidity, power supply voltage, fan speed, communication parameters, operating System (OS) functions, and the like. If any of these variables is outside the limits established, the baseboard management controller will notify the system administrator. The baseboard management controller may provide a network (web) service, which has a network communication function and provides a web page to display a monitoring interface, and an operator may obtain monitoring data of the baseboard management controller by connecting the baseboard management controller of the monitored device through a network cable on a site of the device, or connecting the baseboard management controllers of a plurality of monitored devices through a network in a data center.
Due to the limited performance and pin count of baseboard management controllers, complex programmable logic devices (Complex Programmable logic device, CPLD) are often built into baseboard management controller systems to share the performance pressure of baseboard management controllers and to provide more pins to connect sensors or monitored components as the number of components and items to be monitored increases. The complex programmable logic device is mainly composed of three parts, namely a logic block, a programmable interconnection channel and an input/output block (I/O block). A logic block of a complex programmable logic device typically includes 4-20 macro-cells, each macro-cell typically consisting of an array of product terms, product term assignments, and programmable registers. Each macro unit has a plurality of configuration modes, and each macro unit can be used in cascade connection, so that more complex combinational logic and sequential logic functions can be realized. For complex programmable logic devices with higher integration levels, embedded array blocks with on-chip random access Memory (Random Access Memory, RAM)/Read-Only Memory (ROM) are also typically provided. The programmable interconnect channels mainly provide an interconnect network between logic blocks, macro cells, and input/output pins. An input/output block (I/O block) provides an interface between internal logic to the device I/O pins.
The hard disk is an important component of the server and is an important object of out-of-band monitoring management. According to the type of communication interface, the serial connection small computer system interface (SERIAL ATTACHED SCSI, hereinafter abbreviated as SAS)/serial advanced technology attachment (SERIAL ADVANCED Technology Attachment, hereinafter abbreviated as SATA) interface hard disk and the nonvolatile memory host controller interface (Non Volatile Memory Host Controller Interface Specification, NVMHCIS or NVM Express, hereinafter abbreviated as NVMe) interface hard disk are mainly classified. Wherein the SAS interface is compatible with the SATA interface. According to the type of storage medium, the hard disk is mainly divided into a mechanical hard disk (HARD DISK DRIVE, HDD) and a Solid state disk (Solid STATE DISK or Solid STATE DRIVE, SSD). The mechanical hard disk is mainly an SAS interface or an SATA interface. The solid state disk comprises a SAS interface, a SATA interface and an NVMe interface hard disk.
As shown in fig. 1, if the baseboard management controller wants to obtain the hard disk log data, the baseboard management controller can access the hard disk expansion card through an integrated circuit bus (Inter-INTEGRATED CIRCUIT, IIC or I2C) for the hard disk connected to the hard disk expansion card, the baseboard management controller runs monitoring software to send a pass-through command to the hard disk expansion card, the hard disk expansion card can forward the pass-through command to the hard disk, the hard disk sends corresponding hard disk log data to the hard disk expansion card after responding to the pass-through command, and the hard disk expansion card forwards the hard disk log data to the baseboard management controller. In addition, the NVMe interface hard disk can be directly connected with the central processor through the high-speed serial computer expansion bus, and one path of integrated circuit bus can be provided to the baseboard management controller through the high-speed serial computer expansion bus between the hard disk and the central processor, so that the functions of forwarding commands and hard disk log data for the baseboard management controller, such as a hard disk expansion card, can be realized, and the out-of-band monitoring of the hard disk can be realized.
It can be seen that in the current server monitoring architecture, service data of the device cannot be displayed to the outside due to confidentiality, that is, an operation and maintenance person has no authority to access in-band data to obtain hard disk log data which can be read by a central processor, and a baseboard management controller for implementing out-of-band monitoring cannot directly access the hard disk data, so that the out-of-band monitoring function of the hard disk is limited, so that the out-of-band monitoring party cannot timely and accurately obtain the running state of the hard disk, and further the storage reliability of the hard disk faces a threat.
Because there is no data path between the baseboard management controller and the hard disk without passing through the integrated circuit bus interface, the out-of-band monitoring of the hard disk can only be realized by means of a hard disk expansion card supporting the receipt of the pass-through command through the integrated circuit bus interface or by providing a high-speed serial computer expansion bus of the integrated circuit bus interface, and the out-of-band monitoring of the hard disk without the condition, such as the hard disk under the advanced host controller interface controller, can not be realized.
Referring to fig. 2, an embodiment of the application discloses a hard disk monitoring method, which is applied to a baseboard management controller, and includes:
Step S11: obtaining a compressed data packet corresponding to hard disk log data of a monitored hard disk; the compressed data packet is a data packet obtained by compressing the hard disk log data based on a preset hybrid compression algorithm.
In this embodiment, the baseboard management controller obtains a compressed data packet corresponding to the hard disk log data of the monitored hard disk, that is, a data packet transmitted after compressing the hard disk log data of the monitored hard disk, so that the speed and efficiency of transmitting data to the outside of the hard disk are improved through data compression. When the data compression is executed, the method and the device specifically adopt a preset hybrid compression algorithm to compress the hard disk log data so as to further improve the data compression efficiency, and enable the monitored hard disk to transmit more hard disk log data in a shorter time.
Firstly, it should be noted that, the embodiment of the application specifically has the following two types of out-of-band monitoring architecture for the monitored hard disk by using the baseboard management controller, the first type is to monitor the monitored hard disk by using only the baseboard management controller, specifically, the baseboard management controller is directly connected with the monitored hard disk to monitor the monitored hard disk out-of-band; the second is to monitor the monitored hard disk by using the baseboard management controller and the complex programmable logic device, in particular to realize the out-of-band monitoring of the monitored hard disk by connecting the baseboard management controller with the monitored hard disk by the complex programmable logic device. It should be noted that the scheme of the embodiment of the present application is not limited to the above two architectures, and is applicable as long as the out-of-band monitoring scenario by using the baseboard management controller and the content of the hard disk log data output by the hard disk are involved.
As can be seen from the foregoing, in the related hard disk out-of-band monitoring scheme, the baseboard management controller needs to communicate with the hard disk expansion card or the high-speed serial computer expansion bus connected to the hard disk to obtain the hard disk log data, and the hard disk can only be connected to the hard disk expansion card through the specified data pin to output the hard disk log data, and if the hard disk is not connected to the hard disk expansion card or the high-speed serial computer expansion bus, the baseboard management controller cannot realize out-of-band monitoring of the hard disk. Therefore, the two out-of-band monitoring architectures mentioned in the application break through the hardware limit of the existing scheme, and the method of directly connecting the baseboard management controller with the monitored hard disk or the method of connecting the monitored hard disk through the complex programmable logic device can acquire the hard disk log data of the monitored hard disk.
Pins of a hard disk are mainly divided into three types: data pins, power pins, and hard disk status pins. The data pin of the hard disk is connected with the in-band system, and the power pin of the hard disk is used for connecting a power supply and a ground signal. Therefore, the baseboard management controller has direct access to the hard disk status pins of the hard disk only.
The hard disk state pins of the hard disk mainly comprise a hard disk state indication pin, a hard disk production debugging pin and a hard disk idle pin.
The hard disk state indication pins include a hard disk bit state indication pin (P10 pin), a hard disk read-write state indication pin, and the like (P11 pin). The hard disk state indication pin is a pin for outputting a hard disk state indication signal, for example, the hard disk in-place state indication pin is used for outputting a hard disk in-place state signal, and the hard disk read-write state indication pin is used for outputting a hard disk read-write state signal. When the hard disk is connected to the hard disk backboard, the hard disk status indication pin mainly has two connection modes, one is connected to the baseboard management controller to inform the baseboard management controller of corresponding hard disk status data, and the other is connected to a control circuit on the hard disk backboard to control the status of corresponding controlled elements so that a user can learn the status of the corresponding hard disk. For example, a hard disk status indicator is provided on the hard disk backboard to indicate the hard disk operation status. If the hard disk is in the read-write state, the hard disk read-write state indicating pin can be controlled to output square wave signals to the amplifying driving circuit of the hard disk read-write state indicating lamp so as to control the hard disk read-write state indicating lamp to be on, and if the hard disk is not in the read-write state (idle state), the hard disk read-write state indicating pin is controlled to output a constant level signal (such as a constant high level signal) so as to enable the hard disk read-write state indicating lamp to be off to indicate that the hard disk read-write state indicating lamp is in the idle state, so that a user can know whether the hard disk is in the read-write state or not by watching the on-off of the hard disk read-write state indicating lamp. The hard disk shows the same based on the state of the hard disk bit state indication pin. Or the hard disk can also output two different constant level signals (one high and one low) through the hard disk state indicating pins to indicate different states, and the signals can be input to the baseboard management controller so as to trigger corresponding recording, processing or control.
The hard disk production debugging pins are mainly pins (debug pins) of the hard disk of the SAS or SATA interface beside the SAS or SATA interface, and are usually used in the production debugging stage of the hard disk, and in the actual use of the hard disk, the production debugging pins can be used for outputting guide information in the hard disk initialization stage.
And the NVMe interface hard disk comprises a hard disk idle pin besides the hard disk state indication pin. At present, three connectors, namely an M.2 connector, a U.2 connector and a CEM connector, are mainly adopted for the NVMe interface hard disk. The NVMe interface of the M.2 connector is used for connecting different types of devices, wherein Key B and Key M can be used for connecting a solid state disk. When the NVMe interface of M.2 specification is connected with the solid state disk of the SATA interface, the definition of the P10 pin is the same as that of the P11 pin of the SAS or SATA interface, and the P10 pin is a disk read-write state indication pin. When the NVMe interface of the m.2 specification is connected to the NVMe interface hard disk, the P10 pin is defined as an indicator light control pin. The NVMe interface of U.2 connector is completely compatible with SAS and SATA interfaces, and the P11 pin is also a hard disk read-write status indication pin. The P32 pin of the a-side of the NVMe interface of the CEM connector is an idle pin (Reserved pin), which is also a hard disk status pin other than a hard disk data pin, and there are also a plurality of idle pins at x8 (eight wire interface) and above.
The hard disk status pins are not pins for outputting data of the hard disk, do not have the risk of revealing user data stored in the hard disk, and are directly connected with the baseboard management controller or have the authority of being connected with the baseboard management controller after the hard disk is inserted into the hard disk backboard.
In the hard disk monitoring system provided by the embodiment of the invention, the hard disk status pins of the adopted hard disk may include at least one of a hard disk status indication pin, a hard disk production debugging pin and a hard disk idle pin.
In this embodiment, if hard disk status indication pins such as a hard disk in-place status indication pin and a hard disk read-write status indication pin are used, since these hard disk pins are usually already connected to General-purpose input/output (GPIO) pins of a baseboard management controller or input/output (I/O) pins of a complex programmable logic device, the hardware architecture can be directly used without changing the hardware architecture of a server, which is simple and convenient to implement.
The hard disk production debug pins (debug pins) on current devices are typically floating, typically comprising 4 pins. If the embodiment of the invention adopts the hard disk production debugging pin as the hard disk pin for outputting hard disk log data, the connector with corresponding number of pins can be adopted to connect the hard disk production debugging pin to the GPIO pin of the baseboard management controller chip or the I/O pin of the complex programmable logic device.
Since the idle pins of the hard disk are usually only in the interface of the hard disk of the NVMe (Non Volatile Memory Host Controller Interface Specification, NVMHCIS or NVM Express, nonvolatile memory host controller interface) interface, the high-speed signal cannot be suspended, and the idle pins of the hard disk in the NVMe interface are grounded through a resistor-capacitor circuit on the hard disk backboard after the hard disk is connected to the hard disk backboard. If the embodiment of the invention adopts the idle pin of the hard disk as the hard disk pin for outputting the hard disk log data, the connection relation between the idle pin of the hard disk and the hard disk backboard is changed into the connection relation between the idle pin of the hard disk and the GPIO pin of the baseboard management controller chip or the I/O pin of the complex programmable logic device.
Specifically, the monitored hard disk needs to modulate the initial output signal of the hard disk pin by using the hard disk log data, and then outputs the modulated signal, wherein the initial output signal represents the output signal corresponding to the original function of the hard disk pin, and for the idle pin of the hard disk, the initial output signal is the null signal. The signal modulation method specifically includes the following two modes: firstly, after the monitored hard disk converts hard disk log data into a level signal, the level signal is directly inserted into an initial output signal corresponding to a hard disk pin to obtain a modulated signal, and in the modulation mode, the modulated signal simultaneously carries the hard disk log data and the initial output signal; and the second method is that after the monitored hard disk converts the hard disk log data into a level signal, the level signal is inserted in a time period when the initial output signal corresponding to the hard disk pin is an invalid signal, so as to obtain a modulated signal, and the modulated signal carries the hard disk log data and the initial output signal in a time sharing way in the modulation mode. The modulation mode of the application does not affect the original functions of the hard disk pins, can output hard disk log data, reduces the out-of-band monitoring difficulty, effectively improves the range of the monitored hard disk for out-of-band monitoring of the hard disk, and ensures that the hard disk can output hard disk log data under the condition of not connecting with a hard disk expansion card.
For the two out-of-band monitoring architectures mentioned above, the specific compression process includes three embodiments, in the first out-of-band monitoring architecture, the data compression step is performed by the monitored hard disk, and in the second out-of-band monitoring architecture, the data compression step may be performed by the monitored hard disk or by a complex programmable logic device.
In a specific embodiment, the baseboard management controller is connected with a hard disk pin of the monitored hard disk through a first signal line; correspondingly, the obtaining the compressed data packet corresponding to the hard disk log data of the monitored hard disk includes: acquiring a first output signal of the hard disk pin through the first signal line; the first output signal is a signal obtained by compressing hard disk log data of the monitored hard disk based on a preset hybrid compression algorithm to obtain a compressed data packet, and modulating an initial output signal of the hard disk pin according to the compressed data packet; demodulating the first output signal to obtain the compressed data packet. It can be understood that the baseboard management controller can be directly connected to the hard disk pin of the monitored hard disk through the first signal line, in this case, the monitored hard disk compresses the hard disk log data based on a preset hybrid compression algorithm to obtain a compressed data packet, then modulates the initial output signal of the hard disk pin according to the compressed data packet to obtain and output a first output signal to the baseboard management controller, and the baseboard management controller demodulates the first output signal to obtain the compressed data packet.
In a specific embodiment, the baseboard management controller is connected with a complex programmable logic device through a second signal wire, and the complex programmable logic device is connected with a hard disk pin of the monitored hard disk through a third signal wire; correspondingly, the obtaining the compressed data packet corresponding to the hard disk log data of the monitored hard disk includes: obtaining a compressed data packet which is obtained after the complex programmable logic device demodulates the second output signal of the hard disk pin and is sent through the second signal line; the complex programmable logic device obtains a second output signal of the hard disk pin by using the third signal line, wherein the second output signal is a signal obtained by compressing hard disk log data of the monitored hard disk based on a preset hybrid compression algorithm to obtain a compressed data packet, and modulating an initial output signal of the hard disk pin according to the compressed data packet. It can be understood that in the embodiment of the application, the baseboard management controller is connected with the monitored hard disk through the programmable logic device so as to realize the out-of-band monitoring of the monitored hard disk, wherein the baseboard management controller is connected with the complex programmable logic device through the second signal line, the complex programmable logic device is connected with the hard disk pin of the monitored hard disk through the third signal line, and the monitored hard disk executes the data compression step. Specifically, the monitored hard disk compresses hard disk log data based on a preset hybrid compression algorithm to obtain a compressed data packet, modulates an initial output signal of a hard disk pin according to the compressed data packet to obtain and output a second output signal to the complex programmable logic device, demodulates the second output signal to obtain the compressed data packet by the complex programmable logic device, and sends the compressed data packet to the baseboard management controller.
In a specific embodiment, the baseboard management controller is connected with a complex programmable logic device through a second signal wire, and the complex programmable logic device is connected with a hard disk pin of the monitored hard disk through a third signal wire; correspondingly, the obtaining the compressed data packet corresponding to the hard disk log data of the monitored hard disk includes: obtaining a compressed data packet which is obtained after the complex programmable logic device compresses hard disk log data by using a preset hybrid compression algorithm and is sent through the second signal line; the complex programmable logic device obtains a third output signal of the hard disk pin by using the third signal wire, demodulates the third output signal to obtain the hard disk log data, and the third output signal is a signal obtained after the monitored hard disk modulates the initial output signal of the hard disk pin according to the hard disk log data. It can be understood that in the embodiment of the application, the baseboard management controller is connected with the monitored hard disk through the complex programmable logic device so as to realize the out-of-band monitoring of the monitored hard disk, wherein the baseboard management controller is connected with the complex programmable logic device through the second signal line, the complex programmable logic device is connected with the hard disk pin of the monitored hard disk through the third signal line, and the complex programmable logic device executes the data compression step so as to reduce the requirement on the hard disk to execute the compression step. It should be noted that the main function of the hard disk is to store data as a storage device, and if the compression step of the data needs to be performed by the hard disk, the performance requirement is extremely high, and the hard disk is also prone to the problem of being not adapted to manufacturers when using a compression algorithm. The application also discloses a method for executing the compression step by the complex programmable logic device, specifically, firstly, the monitored hard disk modulates the initial output signal of the hard disk pin according to the hard disk log data to obtain a third output signal and outputs the third output signal to the complex programmable logic device, the complex programmable logic device demodulates the third output signal to obtain the hard disk log data, and then the hard disk log data is compressed and then transmitted to the baseboard management controller.
Step S12: acquiring compression information corresponding to the compression data packet; the compression information comprises a target compression algorithm and target parameters, wherein the target compression algorithm is at least one compression algorithm in the preset hybrid compression algorithm, and the target parameters are parameters generated in the process of compressing the hard disk log data by using the target compression algorithm.
In this embodiment, the baseboard management controller also needs to obtain compression information corresponding to the compressed data packet. It can be understood that the main body (monitored hard disk or complex programmable logic device) executing the compression step can add the compression information to the data compression packet and then send the data compression packet to the baseboard management controller, or can respectively send the compression data packet and the compression information to the baseboard management controller; besides, the compressed information can be collected by other hardware modules and then sent to the baseboard management controller, and the embodiment of the application does not limit the source and the sending mode of the compressed information. Further, the compression information comprises a target compression algorithm and target parameters, wherein the target compression algorithm is at least one compression algorithm in the preset hybrid compression algorithm, and the target parameters are parameters generated in the process of compressing the hard disk log data by using the target compression algorithm; that is, in the case of different data packets, the present application does not need to compress the data by using all compression algorithms in the preset hybrid compression algorithm, but can pertinently execute corresponding compression steps on different hard disk log data by using the target compression algorithm.
Step S13: and determining a corresponding decompression algorithm based on the compression information, and decompressing the compression data packet by using the decompression algorithm to obtain the hard disk log data so as to monitor the monitored hard disk based on the hard disk log data.
In this embodiment, when the baseboard management controller decompresses the compressed data packet, the baseboard management controller can rapidly determine a corresponding decompression algorithm according to the compressed information, so that the decompression efficiency of the compressed data packet can be improved, and out-of-band monitoring of the monitored hard disk is realized based on hard disk log data obtained by decompression. It can be understood that the decompression step and the compression step are corresponding, and if the compressed data packet is compressed by using the algorithm a and the algorithm B sequentially, the decompression is performed by using the algorithm B and the algorithm a sequentially when the data packet is decompressed.
Specifically, after decompressing to obtain the hard disk log data, the baseboard management controller directly displays the hard disk log data on a target interface, determines corresponding preset threshold conditions based on the type of the hard disk log data, and needs to point out that the state information of the hard disk to be monitored comprises temperature, bad track number, error accumulation number and the like, and the threshold conditions corresponding to different state information are inconsistent.
Further, the method further comprises the following steps: after the server is powered on and started, a preset system starting controller is utilized to send a target command to the monitored hard disk; the target command is used for controlling the monitored hard disk to send a preset number of data packets with target sizes to the baseboard management controller; and counting the average compression time and the average decompression time of the data packets with the preset number of target sizes by the system starting controller, and determining a larger value from the average compression time and the average decompression time so as to set the frequency parameter of the monitored hard disk output hard disk log data by using the larger value. In this embodiment, the system boot controller may be specifically built based on a unified extensible firmware interface (Unified Extensible FIRMWARE INTERFACE, UEFI) or a basic input-output system (Basic Input Output System, BIOS). After the server is powered on and started, a target command can be sent to the monitored hard disk by using the system starting controller, the target command is used for controlling the monitored hard disk to send data packets with preset number of target sizes to the baseboard management controller, for example, the monitored hard disk can be commanded to send data packets with the size of 100 data packets of 64KB, the average compression time and the average decompression time of the 100 data packets are counted by the system starting controller, a larger value is determined from the average compression time and the average decompression time, so that the frequency parameter of the log data of the monitored hard disk output hard disk is set by using the larger value, namely, the frequency parameter of the log data of the hard disk output hard disk is configured by taking the maximum value of the average compression time and the average decompression time, so that the data sending frequency, the data compression frequency and the data decompression frequency can be kept approximately consistent, and the normal operation of the system is facilitated. In addition, when the operating system installs the driver, the monitored hard disk can be also re-instructed to send new data packets with preset target sizes, so as to obtain the latest average compression time and average decompression time to update the frequency parameters.
The beneficial effects are that: in the application, the compressed data packet corresponding to the hard disk log data of the monitored hard disk is obtained by the baseboard management controller, namely the data packet which is transmitted after the hard disk log data of the monitored hard disk is compressed, so that the speed and the efficiency of transmitting the data outwards of the hard disk are improved through data compression. When the data compression is executed, the method specifically adopts the preset hybrid compression algorithm to compress the hard disk log data so as to further improve the data compression efficiency, so that the monitored hard disk can transmit more hard disk log data in a shorter time, and for the condition of different data packets, the method does not need to compress the data by using all compression algorithms in the preset hybrid compression algorithm, but can pertinently execute corresponding compression steps on different hard disk log data by using a target compression algorithm, wherein the target compression algorithm is at least one compression algorithm in the preset hybrid compression algorithm. And finally, when the baseboard management controller decompresses the compressed data packet, the baseboard management controller can rapidly determine a corresponding decompression algorithm according to the compressed information, so that the decompression efficiency of the compressed data packet can be improved, and the out-of-band monitoring of the monitored hard disk is realized based on the hard disk log data obtained by decompression. Through the scheme, the application also realizes high-efficiency and reliable out-of-band monitoring on the basis of improving the efficiency of transmitting the hard disk log data by the hard disk.
Referring to fig. 3, an embodiment of the present application discloses a specific method for monitoring a hard disk, and compared with the previous embodiment, the present embodiment further describes and optimizes a technical solution. The method specifically comprises the following steps:
step S21: obtaining a compressed data packet corresponding to hard disk log data of a monitored hard disk; the compressed data packet is a data packet obtained by compressing the hard disk log data based on a preset hybrid compression algorithm.
Step S22: acquiring compression information corresponding to the compression data packet; the compression information comprises a target compression algorithm and target parameters, wherein the target compression algorithm is a first compression algorithm in the preset mixed compression algorithm, and the first compression algorithm is used for performing text matching on currently stored data and historical stored data in a constructed hash table so as to output unmatched text and a target binary sequence according to a text matching result; the target parameter is a parameter generated in the process of compressing the hard disk log data by using the target compression algorithm.
In this embodiment, the compressed data packet may be obtained by compressing the hard disk log data using only the first compression algorithm in the preset hybrid compression algorithm. The first compression algorithm is mainly used for carrying out text matching on the current stored data and the historical stored data in the constructed hash table so as to output unmatched texts and target binary group sequences according to text matching results, and by using the first compression algorithm, only two groups of sequence output data and unmatched texts are finally output, so that transmission data can be effectively reduced. Specifically, the first compression algorithm is an improved LZ78 (Lempel-Ziv 1978, a compression algorithm based on dictionary coding), and first LZ78 compression is relatively to LZ77 compression, so that transmission data can be effectively reduced, compression time for a subsequent compression method is advantageously shortened, and the application further improves the original LZ78 algorithm.
In addition, considering that a complete dictionary needs to be maintained in the compression and decompression process of the LZ78 algorithm, more memory may be consumed; therefore, the method and the device can monitor the use condition of various items in the dictionary in real time based on the pre-configured dictionary optimization strategy, and automatically trigger the dictionary compression mechanism if target items with unused duration reaching the preset duration threshold exist, so as to remove the target items from the dictionary, realize the dynamic compression of the dictionary scale, keep the compactness and the high efficiency of the dictionary and avoid consuming excessive memory.
Specifically, the process of compressing the hard disk log data by using the first compression algorithm includes: constructing the hash table and dividing the hard disk log data into at least one character string; and sequentially storing the at least one character string into the hash table based on the first compression algorithm until the last character string is stored into the hash table, and outputting a corresponding unmatched text and a target tuple sequence to obtain the compressed data packet based on the unmatched text and the target tuple sequence. That is, the present application firstly constructs a two-dimensional hash table, initially, the hash table has no element, and then divides the hard disk log data into at least one character string, so that the divided character strings are sequentially stored in the hash table through a first compression algorithm. Specifically, as shown in fig. 4, the hard disk log data in fig. 4 is "AFFCFCAFAFCAAFCAAF", and is divided into a plurality of strings such as "a", "F", "FC", "FCA", "FA", "FCAA", "FCAAF", and the like, and then these strings are sequentially loaded into the hash table, so as to obtain the hash table on the right side in fig. 4, and after the last string is stored in the hash table, the corresponding unmatched text and the target binary sequence are output.
In a specific embodiment, the above process of sequentially storing the at least one character string in the hash table based on the first compression algorithm includes: judging whether a text match exists between a first character string which is currently stored and a history character string which is already stored in the hash table; if the first character string and the history character string are not matched in text, storing the first character string into a preset unmatched text; if a second character string is matched with the first character string in the history character strings, confirming the text matching length, and judging whether the text matching length exceeds a first preset threshold value or not; if the text matching length does not exceed the first preset threshold value, storing the first character string into the unmatched text; if the text matching length exceeds the first preset threshold, outputting a corresponding target binary group sequence, and storing characters, which are not matched with the second character string, in the first character string into the unmatched text; wherein; the target tuple sequence includes the text matching length and an initial character position of the second string.
That is, each time a current first character string is stored, whether the first character string is matched with a text in the hash table is judged, if no text match exists or the text match length is smaller than a first preset threshold value, the first character string is stored into the unmatched text, and otherwise, a target binary sequence is output. The data in the hash table is stored in the form of key-value (key-value pair), assuming that the first preset threshold is 4, and the above procedure is described with a specific example in fig. 4:
1. Firstly, putting the character string A into the (0, 0) position of a hash table, namely, setting key (0, 0) as A and setting value (0, 0) as 1; because A is the first character in the hash table, no history character string exists before, so that text matching does not exist, and A is stored into a preset unmatched text; or determining whether the A is required to be stored in the unmatched text by judging the number of the row of value 1, and storing the character string A with the value 1 in the unmatched text and clearing the value because the number of the row of value 1 is1 and is smaller than a first preset threshold value 4; at this time, the unmatched text is A;
2. The next character string is F, and whether the same value (F) exists in the keys of the first column is sequentially confirmed, and because only A exists in the hash table and the same value F does not exist at the moment, F is added to the last row of the current first column, namely, the keys (1, 0) are F at the moment, and the value (1, 0) is 1; since there is no text match, F is also stored in the unmatched text; or the number of the lines of value 1 can be judged, and the character string F with the value 1 is stored in an unmatched text and cleared because the value 1 is smaller than 4 at the moment; at this time, the unmatched text is AF;
3. The next character string is FC, firstly, sequentially confirming whether the keys in the first column have the same value (F), if yes, setting the corresponding value to be 1, namely value (1, 0) =1, confirming whether the possible keys (1, 1) have the same value according to the next character (C), and when the keys (1, 1) are empty, setting the keys (1, 1) to be C and the value (1, 1) to be 1; at this time, the text matching length can be considered as 2 and is smaller than 4, so that F is also stored in the unmatched text; or judging the number of the lines of value as 1, wherein 2 is smaller than 4, storing the character string FC with the value as 1 into an unmatched text and clearing the value; at this point the unmatched text is AFFC;
4. The next character string is FCA, firstly, sequentially confirming whether the first row of keys has the same value (F), if yes, letting value (1, 0) =1, confirming whether the possible keys (1, 1) are the same value according to the next character (C), if yes, letting value (1, 1) =1, confirming whether the possible keys (1, 2) are the same value according to the next character (a), and if key (1, 2) is empty, letting key (1, 2) be a, and letting value (1, 2) be 1; at this time, the text matching length can be regarded as 3 and is smaller than 4, so that FCA is also stored in the unmatched text; or judging the number of the lines of value 1, wherein 3 is smaller than 4, storing the character strings FCA with the value 1 into unmatched texts and clearing the value; at this point the unmatched text is AFFCFCA;
5. Sequentially confirming whether the first row of keys has the same value (F) or not by taking the next character string as FA, if so, making the value (1, 0) =1, confirming whether the possible keys (1, 1) have the same value or not according to the next character (A), and clearing the value (1, 1) if not being empty and not being (A), continuously searching whether the keys have the same value (F) or not from the first row, if not, adding F to the last row of the current first row, and adding A to the next row of keys (2, 0) =F, value (2, 0) =1, key (2, 1) =A, and value (2, 1) =1; at this time, the text matching length can be considered as 2 and less than 4, so that the FA is also stored in the unmatched text; or judging the number of the lines of value 1, wherein 2 is smaller than 4, storing the character strings FA with the value 1 into unmatched texts and clearing the value; at this point the unmatched text is AFFCFCAFA;
6. The next character string is FCAA, which is carried out according to the step 4; at this time, the second character string matched with the first character string is FCA, the text matching length can be considered as 4 and is equal to the first preset threshold value 4, so that a corresponding target binary group sequence (the text matching length, the initial character position of the second character string) is output, the initial character of the second character string FCA is F, and the position in fig. 4 is 4, namely the target binary group sequence is (4, 4); or judging the number of the row value as 1, which is equal to 4, outputting (4, 4), and clearing the value; at this time, the last character a of the first character string FCAA, which is not matched with the second character string FCA, is also stored in the unmatched text; at this point the unmatched text is AFFCFCAFAA;
7. The next character string is FCAAF, and FCAAF is also carried out according to the step 4; at this time, the second character string matched with the first character string is FCAA, and the text matching length can be considered as 5 and is larger than the first preset threshold value 4, so that a corresponding target binary group sequence (the text matching length and the initial character position of the second character string) is output, namely (5, 9); or judging the number of the row value as 1, wherein at the moment, 5 is more than 4, outputting (5, 9), and resetting the value; at this point, the last character (F) is also stored in the unmatched text, which is AFFCFCAFAAF.
In this way, through the first compression algorithm, the unmatched text is AFFCFCAFAAF. The target binary sequences were obtained as (4, 4) and (5, 9).
Step S23: and determining a corresponding decompression algorithm based on the compression information, and decompressing the compression data packet by using the decompression algorithm to obtain the hard disk log data so as to monitor the monitored hard disk based on the hard disk log data.
For more specific processing procedures in the steps S21 and S23, reference may be made to the corresponding contents disclosed in the foregoing embodiments, and no detailed description is given here.
Therefore, the method can only use the first compression algorithm in the preset hybrid compression algorithm to compress the hard disk log data to obtain the compressed data packet. The first compression algorithm is mainly used for performing text matching on the current stored data and the historical stored data in the constructed hash table, if text matching does not exist or the text matching length is smaller than a first preset threshold value, the current stored data is stored in the unmatched text, and otherwise, a target binary sequence is output. Before this, the hard disk log data is divided into at least one character string, so that the at least one character string is sequentially stored in the hash table based on the first compression algorithm. By using the first compression algorithm to compress and then transmit the data in the data transmission process, the transmission efficiency of the hard disk log data is improved, so that the monitored hard disk can transmit more hard disk log data in a shorter time.
Further, the preset hybrid compression algorithm may further include a second compression algorithm and a third compression algorithm in addition to the first compression algorithm; referring to fig. 5 and fig. 6, an embodiment of the present application provides a method for compressing hard disk log data based on a first compression algorithm, a second compression algorithm and a third compression algorithm, which specifically includes:
Step S31: and when the size of the hard disk log data meets a second preset threshold value, compressing the hard disk log data by using the first compression algorithm to output a corresponding unmatched text and a target binary group sequence.
In this embodiment, assuming that the second preset threshold is 64KB, after the size of the hard disk log data reaches 64KB, the hard disk log data starts to be compressed by using the first compression algorithm to output a corresponding unmatched text and a target tuple sequence, and then corresponding compression processes are respectively executed for the unmatched text and the target tuple sequence. Similarly, when the new hard disk log data reaches 64KB, the first compression algorithm is continuously utilized to compress the new hard disk log data.
Step S32: and determining the repetition times of each character in the unmatched text to determine the maximum repetition times, and compressing the unmatched text by using the second compression algorithm and/or the third compression algorithm to obtain first compressed data under the condition that the maximum repetition times are different from the total text length of the unmatched text.
In this embodiment, for the unmatched text, the number of repetitions of each character in the unmatched text needs to be counted first to determine the maximum number of repetitions, taking hard disk log data "AFFCFCAFAFCAAFCAAF" in fig. 4 as an example, and as can be known from the foregoing, the corresponding unmatched text is AFFCFCAFAAF; the number of repetitions of the character a is 4, the number of repetitions of the character C is 2, and the number of repetitions of the character F is 5, then the maximum number of repetitions is 5, and the total length of the text of the unmatched text is 11, and the maximum number of repetitions is different from the total length of the text of the unmatched text, so that the unmatched text is further compressed by using the second compression algorithm and/or the third compression algorithm to obtain the first compressed data.
In addition, the method further comprises the following steps: if the maximum repetition number is the same as the total text length, directly outputting text tuple information and taking the text tuple information as the target parameter, and then prohibiting the step of compressing the unmatched text by using the second compression algorithm and/or the third compression algorithm to obtain first compressed data; wherein the text tuple information includes character information of the unmatched text and the total text length. That is, if the maximum repetition number is the same as the total text length, directly outputting text tuple information and taking the text tuple information as a target parameter, and compressing the unmatched text without using the second compression algorithm and/or the third compression algorithm, wherein the text tuple information includes character information, that is, which character and the total text length. For example, when the unmatched text is FFFFF, the maximum number of repetitions and the total length of the text are the same at this time, both are 5, and thus text binary group information (F, 5) is directly output.
In a specific embodiment, when the maximum repetition number is different from the total text length of the unmatched text, compressing the unmatched text by using the second compression algorithm and/or the third compression algorithm to obtain first compressed data includes: judging whether the maximum repetition number and the text total length meet a preset condition or not under the condition that the maximum repetition number and the text total length of the unmatched text are different; if the maximum repetition number and the total text length meet the preset conditions, compressing the unmatched text by using the second compression algorithm to obtain initial compressed data, and then compressing the initial compressed data by using the third compression algorithm to obtain first compressed data; and if the maximum repetition number and the total text length do not meet the preset conditions, compressing the unmatched text by using the third compression algorithm to obtain first compressed data. Namely, under the condition that the maximum repetition number is different from the total text length of the unmatched text, further judging whether the maximum repetition number and the total text length meet the preset conditions, if so, firstly compressing the unmatched text by using a second compression algorithm to obtain initial compressed data, and then compressing the initial compressed data by using a third compression algorithm to obtain first compressed data, namely, under the condition that the maximum repetition number and the total text length meet the preset conditions, successively compressing the unmatched text by using the second compression algorithm and the third compression algorithm to obtain the first compressed data; in addition, if the maximum repetition number and the total text length do not meet the preset conditions, the unmatched text is compressed by using the third compression algorithm only to obtain first compressed data.
Specifically, the determining whether the maximum repetition number and the total text length meet the preset conditions includes: judging whether the maximum repetition number is smaller than or equal to the sum of the total text length and a preset non-zero numerical value; and if the maximum repetition number is smaller than or equal to the sum of the total text length and a preset non-zero value, judging that the maximum repetition number and the total text length meet the preset condition, otherwise, judging that the maximum repetition number and the total text length do not meet the preset condition. That is, the embodiment of the application judges whether the maximum repetition number and the total text length meet the preset condition by judging whether the maximum repetition number is less than or equal to the sum of the total text length and the preset non-zero number. That is, the maximum number of repetitions and the total text length need to satisfy the following expression:
The maximum repetition number is less than or equal to the total text length +a;
Wherein a is a preset non-zero value, for example, the value of a can be 4; and the total length of the prescribed text is not less than 7.
Step S33: and under the condition that the values of the sequences in the target binary group sequence are not the same, compressing the target binary group sequence by using the third compression algorithm to obtain second compressed data.
In this embodiment, for the target tuple sequence, it is first required to determine whether the values of each sequence in the target tuple sequence are the same, taking the hard disk log data "AFFCFCAFAFCAAFCAAF" in fig. 4 as an example, and as can be known from the foregoing, the corresponding target tuple sequences are (4, 4) and (5, 9), where the sequences corresponding to the text matching lengths are 4, 5; the sequences corresponding to the initial character positions of the second character string are 4 and 9 and are different values, so that a third compression algorithm is needed to compress the target binary sequence to obtain corresponding second compressed data.
Assuming that the target sequences of tuples are (4, 5), the values of the sequences are considered to be the same value. Thus further, the method further comprises: if the values of the sequences in the target binary sequence are the same, directly outputting numerical information and the number of the binary groups, taking the numerical information and the number of the binary groups as the target parameters, and prohibiting the step of compressing the target binary sequence by using the third compression algorithm to obtain second compressed data. That is, if the values of each sequence in the target binary sequence are the same, the numerical information (4, 5) and the binary number are directly output: and 2, taking the numerical information and the number of the tuples as target parameters, and compressing the target tuple sequence without using a third compression algorithm.
In addition, it should be noted that, before the compressing the target tuple sequence by using the third compression algorithm to obtain the second compressed data, the method further includes: acquiring a historical binary sequence, and judging whether a binary sequence identical to the target binary sequence exists in the historical binary sequence; if the data exists, the historical compressed data corresponding to the same binary group sequence is directly copied to be used as second compressed data. That is, if the two-tuple sequence identical to the target two-tuple sequence exists in the historical two-tuple sequence, it is indicated that the same data has been compressed once before, and then the historical compressed data corresponding to the same two-tuple sequence is directly copied as the second compressed data, so that a compression step is not required to be executed again, further saving time cost and improving data transmission efficiency.
In a specific embodiment, the compressing the target tuple sequence by using the third compression algorithm to obtain second compressed data includes: normalizing the target binary sequence to obtain a processed binary sequence; and compressing the processed binary sequence by using the third compression algorithm to obtain second compressed data. That is, when the third compression algorithm is used, the target binary sequence needs to be normalized, and then the processed binary sequence is compressed by the third compression algorithm to obtain the second compressed data. Specifically, a compression initial table is established according to the normalized values, the reconstruction compression table is disturbed by the state column of the compression initial table, the values of the sequences of the two groups are sequentially input, and the values are compressed by using a third compression algorithm.
In the above compression process, the second compression algorithm used may be, for example, huffman (Huffman) algorithm, and the third compression algorithm may be, for example, FSE (FINITE STATE Entropy ) algorithm, but this is only a specific example given by the present application, and the present application is not limited to which algorithms the second and third compression algorithms are specific.
Taking the Huffman algorithm as an example, in the process of using the Huffman algorithm, different parts of the Huffman tree can be respectively and simultaneously generated based on the parallel processing capability of the multi-core processor in order to improve the construction efficiency of the Huffman tree, and finally, the different parts are combined to obtain the complete Huffman tree. Specifically, the text to be compressed can be dynamically task-divided according to the current load condition of each processor, each text processing task obtained after division is respectively sent to the corresponding processor to generate a corresponding partial Huffman tree structure, and then the partial Huffman tree structures generated by each processor are combined to obtain a corresponding complete Huffman tree. The dynamic task partitioning process needs to ensure that each processor can complete the operation of generating and outputting the corresponding Huffman tree structure in the same time period, so as to avoid that a certain processor needs to wait a long time to merge the global Huffman tree structure after generating the corresponding Huffman tree structure.
In addition, taking the FSE algorithm as an example, in the process of using the FSE algorithm, in order to further improve the compression rate, a multi-stage compression strategy may be adopted, that is, the data text to be compressed is first compressed in one stage, then compressed in two stages, and so on. And as to whether the compression stage numbers of the several stages are adopted, the analysis can be performed in advance according to the quantity scale of the data text required to be compressed and the data characteristics so as to determine that the compression process of the several stages is adopted later. That is, the FSE algorithm in the present application is an improved FSE algorithm with a compression level dynamic setting policy pre-configured therein, and when the data text to be compressed is input into the improved FSE algorithm, the algorithm will first utilize the pre-configured compression level dynamic setting policy and determine the current real-time compression level according to the number scale and the data characteristics of the data text to be compressed, and then trigger the compression processing of the corresponding level according to the current real-time compression level. The improved FSE algorithm can be adapted to various types of data texts, and the data texts of different types can be guaranteed to have higher compression ratios.
Step S34: and obtaining the compressed data packet based on the first compressed data and the second compressed data, and recording the compression algorithm used this time to obtain the target compression algorithm.
In this embodiment, a compressed data packet is obtained based on the first compressed data and the second compressed data, and parameters generated in the process of compressing the hard disk log data by using the target compression algorithm are recorded as target parameters, and the compression algorithm used this time is recorded to obtain the target compression algorithm.
In a specific embodiment, the target parameter and the target compression algorithm may be used as compression information and added to a data check layer of the compressed data packet to be output to the baseboard management controller together, or the compression parameter and the compressed data packet may be sent to the baseboard management controller separately.
Referring to fig. 7, the baseboard management controller determines whether the compressed data packet is compressed by using the first compression algorithm, the second compression algorithm or the third compression algorithm according to the compression information, if the algorithms are all used, sequentially decompresses the compressed data packet by using the third compression algorithm, the second compression algorithm and the first compression algorithm, and finally restores the decompressed data to obtain hard disk log data, and if the current compressed data packet is not the last data packet, continuously decompresses the next data packet.
It can be seen that the embodiment of the application provides a method for compressing hard disk log data based on a first compression algorithm, a second compression algorithm and a third compression algorithm, and firstly, the hard disk log data is compressed by using the first compression algorithm so as to output a corresponding unmatched text and a target binary group sequence as long as the size of the hard disk log data meets a second preset threshold. Secondly, aiming at the unmatched text and the target binary sequence, the application respectively adopts a corresponding compression algorithm to execute a corresponding compression flow so as to obtain corresponding first compression data and second compression data, and can directly output target parameters without compressing the unmatched text and the target binary sequence under special conditions. Therefore, the method and the device can pertinently execute corresponding compression steps on different hard disk log data by utilizing the target compression algorithm so as to further improve the compression efficiency.
Referring to fig. 8, the present application is exemplified by using a baseboard management controller and a complex programmable logic device to monitor a monitored hard disk, and specifically, the complex programmable logic device performs a data compression step, so as to describe the technical scheme of the present application in detail.
The hard disk monitoring system architecture in fig. 8 is first composed of a baseboard management controller, a first target bus, a second target bus, a complex programmable logic device, a monitored hard disk and a system start controller. Wherein:
The substrate management controller is connected with the complex programmable logic devices on each hard disk backboard/mainboard in the server system through the first target bus and the second target bus, and is responsible for acquiring hard disk log data stored in each complex programmable logic device through the second target bus in a polling mode, or receiving an interrupt signal sent by the complex programmable logic device through the first target bus, and acquiring the hard disk log data stored in the corresponding complex programmable logic device through the second target bus.
The first target bus is a signal bus for out-of-band management in the server system, and meets the requirement that the complex programmable logic device sends an interrupt signal to the baseboard management controller; the first target bus is an optional component when the second target bus supports the interrupt function.
The second target bus is an out-of-band managed data bus in the server system and works in a mode of one master and multiple slaves, wherein the baseboard management controller is a master device, each complex programmable logic device is a slave device, and the second target bus is an optional component.
The baseboard management controller is internally provided with a data decompression module which is used for decompressing the obtained compressed data packet.
The complex programmable logic device consists of a hard disk monitoring data service module, a pulse width demodulation module and a data compression module:
the hard disk monitoring data service module is responsible for receiving and temporarily storing the hard disk log data demodulated by the pulse width demodulation module, sending an interrupt to the substrate management controller through the first target bus when the data exist, responding to a data reading request sent by the substrate management controller through the second target bus and returning the hard disk log data.
The pulse width demodulation module is connected to a pin of a monitored hard disk through a pin, and accurately identifies the level duration of the current output signal of the pin of the hard disk, so as to demodulate the current output signal based on the level duration and obtain the log data of the hard disk.
The data compression module is internally provided with a data caching unit which can cache 128KB of data, and the hard disk log data is compressed by using a preset hybrid compression algorithm while receiving the data.
The monitored hard disk sends data packets with the size of 64KB through a hard disk pin each time, and the hard disk sends the data packets at fixed frequency.
The system starting controller can automatically detect the version numbers of the monitored hard disk, the substrate management controller and the complex programmable logic device when the server is started, and can determine whether the hard disk, the complex programmable logic device and the substrate management controller support the out-of-band monitoring function simultaneously by detecting the version numbers of the monitored hard disk, the substrate management controller and the complex programmable logic device, and if the monitored hard disk, the substrate management controller support the out-of-band monitoring function, the out-of-band monitoring function of the three modules is started. It can be understood that the embodiment of the application performs debugging configuration on the hard disk, the complex programmable logic device and the baseboard management controller in advance, and modifies the respective version information, so that the out-of-band monitoring system formed by the hard disk, the complex programmable logic device and the baseboard management controller can have the respective required out-of-band monitoring function, thereby enabling the whole out-of-band monitoring system to normally operate. In the UEFI stage, the system start controller firstly commands the hard disk to send data packets with the size of 64KB for 100 times, determines the average time for the data compression module to compress the 64KB data in the complex programmable logic device and the average time for the data decompression module to decompress the 64KB data in the baseboard management controller, and configures the sending frequency parameters of the management log of the hard disk by taking the maximum value of the average time and the average time.
Referring to fig. 9, an embodiment of the application discloses a method for monitoring a hard disk, which is applied to a monitored hard disk, and comprises the following steps:
Step S41: compressing hard disk log data based on a preset hybrid compression algorithm to obtain a compressed data packet, and sending the compressed data packet to a baseboard management controller;
Step S42: determining compression information corresponding to the compressed data packet; the compression information comprises a target compression algorithm and target parameters, wherein the target compression algorithm is at least one compression algorithm in the preset hybrid compression algorithm, and the target parameters are parameters generated in the process of compressing the hard disk log data by using the target compression algorithm;
Step S43: and sending the compressed information to a baseboard management controller so that the baseboard management controller determines a corresponding decompression algorithm based on the compressed information, and decompressing the compressed data packet by using the decompression algorithm to obtain the hard disk log data so as to monitor the monitored hard disk based on the hard disk log data.
The beneficial effects are that: in the application, the monitored hard disk can compress the hard disk log data and then send the compressed data packet to the baseboard management controller, and the speed and efficiency of transmitting the data to the outside of the monitored hard disk can be improved through data compression. When the data compression is executed, the method specifically adopts the preset hybrid compression algorithm to compress the hard disk log data so as to further improve the data compression efficiency, so that the monitored hard disk can transmit more hard disk log data in a shorter time, and for the condition of different data packets, the method does not need to compress the data by using all compression algorithms in the preset hybrid compression algorithm, but can pertinently execute corresponding compression steps on different hard disk log data by using a target compression algorithm, wherein the target compression algorithm is at least one compression algorithm in the preset hybrid compression algorithm. In addition, the target parameters generated in the process of compressing the hard disk log data by using the target compression algorithm are also sent to the baseboard management controller, so that the baseboard management controller can rapidly determine the corresponding decompression algorithm according to the compression information when decompressing the compressed data packet, the decompression efficiency of the compressed data packet can be improved, and the out-of-band monitoring of the monitored hard disk is realized based on the hard disk log data obtained by decompression. Through the scheme, the application also realizes high-efficiency and reliable out-of-band monitoring on the basis of improving the efficiency of transmitting the hard disk log data by the hard disk.
Referring to fig. 10, an embodiment of the present application discloses a hard disk monitoring device, which is applied to a baseboard management controller, and the device includes:
The compressed data acquisition module 01 is used for acquiring a compressed data packet corresponding to the hard disk log data of the monitored hard disk; the compressed data packet is a data packet obtained by compressing the hard disk log data based on a preset hybrid compression algorithm;
An information reading module 02, configured to obtain compressed information corresponding to the compressed data packet; the compression information comprises a target compression algorithm and target parameters, wherein the target compression algorithm is at least one compression algorithm in the preset hybrid compression algorithm, and the target parameters are parameters generated in the process of compressing the hard disk log data by using the target compression algorithm;
and the decompression module 03 is configured to determine a corresponding decompression algorithm based on the compression information, and decompress the compressed data packet by using the decompression algorithm to obtain the hard disk log data, so as to monitor the monitored hard disk based on the hard disk log data.
The beneficial effects are that: in the application, the compressed data packet corresponding to the hard disk log data of the monitored hard disk is obtained by the baseboard management controller, namely the data packet which is transmitted after the hard disk log data of the monitored hard disk is compressed, so that the speed and the efficiency of transmitting the data outwards of the hard disk are improved through data compression. When the data compression is executed, the method specifically adopts the preset hybrid compression algorithm to compress the hard disk log data so as to further improve the data compression efficiency, so that the monitored hard disk can transmit more hard disk log data in a shorter time, and for the condition of different data packets, the method does not need to compress the data by using all compression algorithms in the preset hybrid compression algorithm, but can pertinently execute corresponding compression steps on different hard disk log data by using a target compression algorithm, wherein the target compression algorithm is at least one compression algorithm in the preset hybrid compression algorithm. And finally, when the baseboard management controller decompresses the compressed data packet, the baseboard management controller can rapidly determine a corresponding decompression algorithm according to the compressed information, so that the decompression efficiency of the compressed data packet can be improved, and the out-of-band monitoring of the monitored hard disk is realized based on the hard disk log data obtained by decompression. Through the scheme, the application also realizes high-efficiency and reliable out-of-band monitoring on the basis of improving the efficiency of transmitting the hard disk log data by the hard disk.
In some embodiments, the baseboard management controller is connected with a hard disk pin of the monitored hard disk through a first signal line;
Correspondingly, the compressed data obtaining module 01 may specifically include:
A first signal obtaining unit, configured to obtain a first output signal of the hard disk pin through the first signal line; the first output signal is a signal obtained by compressing hard disk log data of the monitored hard disk based on a preset hybrid compression algorithm to obtain a compressed data packet, and modulating an initial output signal of the hard disk pin according to the compressed data packet;
and the demodulation unit is used for demodulating the first output signal to obtain the compressed data packet.
In some specific embodiments, the baseboard management controller is connected with a complex programmable logic device through a second signal line, and the complex programmable logic device is connected with a hard disk pin of the monitored hard disk through a third signal line;
Correspondingly, the compressed data obtaining module 01 may be specifically configured to obtain a compressed data packet obtained after the complex programmable logic device demodulates the second output signal of the hard disk pin and sent through the second signal line; the complex programmable logic device obtains a second output signal of the hard disk pin by using the third signal line, wherein the second output signal is a signal obtained by compressing hard disk log data of the monitored hard disk based on a preset hybrid compression algorithm to obtain a compressed data packet, and modulating an initial output signal of the hard disk pin according to the compressed data packet.
In some specific embodiments, the baseboard management controller is connected with a complex programmable logic device through a second signal line, and the complex programmable logic device is connected with a hard disk pin of the monitored hard disk through a third signal line;
Correspondingly, the compressed data obtaining module 01 may be specifically configured to obtain a compressed data packet obtained by compressing hard disk log data by using a preset hybrid compression algorithm and sent through the second signal line by using the complex programmable logic device; the complex programmable logic device obtains a third output signal of the hard disk pin by using the third signal wire, demodulates the third output signal to obtain the hard disk log data, and the third output signal is a signal obtained after the monitored hard disk modulates the initial output signal of the hard disk pin according to the hard disk log data.
In some embodiments, the target compression algorithm is a first compression algorithm of the preset hybrid compression algorithm; the first compression algorithm is used for performing text matching on the current stored data and the historical stored data in the constructed hash table so as to output unmatched text and a target binary sequence according to a text matching result.
In some specific embodiments, in the process of compressing the hard disk log data by using the target compression algorithm, the apparatus further includes:
the character string dividing unit is used for constructing the hash table and dividing the hard disk log data into at least one character string;
And the hash table operation unit is used for sequentially storing the at least one character string into the hash table based on the first compression algorithm until the last character string is stored into the hash table and then outputting a corresponding unmatched text and a target binary group sequence so as to obtain the compressed data packet based on the unmatched text and the target binary group sequence.
In some specific embodiments, in the process of sequentially storing the at least one character string in the hash table based on the first compression algorithm, the apparatus further includes:
The matching judging unit is used for judging whether the text matching exists between the first character string which is currently stored and the history character string which is already stored in the hash table;
A matching result determining unit, configured to store the first character string into a preset unmatched text if text matching does not exist in both the first character string and the history character string; if a second character string is matched with the first character string in the history character strings, confirming the text matching length, and judging whether the text matching length exceeds a first preset threshold value or not;
The threshold value comparison unit is used for storing the first character string into the unmatched text if the text matching length does not exceed the first preset threshold value; if the text matching length exceeds the first preset threshold, outputting a corresponding target binary group sequence, and storing characters, which are not matched with the second character string, in the first character string into the unmatched text; wherein; the target tuple sequence includes the text matching length and an initial character position of the second string.
In some specific embodiments, the preset hybrid compression algorithm further includes a second compression algorithm and a third compression algorithm;
Correspondingly, in the process of compressing the hard disk log data based on a preset hybrid compression algorithm, the device further comprises:
the first compression unit is used for compressing the hard disk log data by utilizing the first compression algorithm when the size of the hard disk log data meets a second preset threshold value so as to output a corresponding unmatched text and a target binary group sequence;
The second compression unit is used for determining the repetition times of all characters in the unmatched text to determine the maximum repetition times, and compressing the unmatched text by using the second compression algorithm and/or the third compression algorithm to obtain first compression data under the condition that the maximum repetition times are different from the total text length of the unmatched text;
The third compression unit is used for compressing the target binary group sequence by utilizing the third compression algorithm to obtain second compressed data under the condition that the values of the sequences in the target binary group sequence are not the same;
And the data packet acquisition unit is used for acquiring the compressed data packet based on the first compressed data and the second compressed data and recording the compression algorithm used this time to acquire the target compression algorithm.
In some embodiments, the second compression unit specifically includes:
a condition judging unit, configured to judge whether the maximum repetition number and the total text length meet a preset condition when the maximum repetition number and the total text length of the unmatched text are different;
the fourth compression unit is used for compressing the unmatched text by using the second compression algorithm to obtain initial compression data if the maximum repetition number and the total text length meet the preset condition, and then compressing the initial compression data by using the third compression algorithm to obtain first compression data;
and the fifth compression unit is used for compressing the unmatched text by using the third compression algorithm to obtain first compression data if the maximum repetition number and the total text length do not meet the preset conditions.
In some specific embodiments, the condition determining unit may specifically include:
the preset condition determining unit is used for judging whether the maximum repetition number is smaller than or equal to the sum of the total text length and a preset non-zero number;
And the result determining unit is used for judging that the maximum repetition number and the total text length meet the preset condition if the maximum repetition number is smaller than or equal to the sum of the total text length and a preset non-zero value, or else judging that the maximum repetition number and the total text length do not meet the preset condition.
In some embodiments, the device is further configured to directly output text tuple information and take the text tuple information as the target parameter if the maximum number of repetitions is the same as the total text length, and prohibit execution of the step of compressing the unmatched text by using the second compression algorithm and/or the third compression algorithm to obtain first compressed data; wherein the text tuple information includes character information of the unmatched text and the total text length.
In some embodiments, the device is further configured to directly output numerical information and the number of tuples if values of sequences in the target tuple sequence are the same numerical value, and use the numerical information and the number of tuples as the target parameter, and then prohibit execution of the step of compressing the target tuple sequence by using the third compression algorithm to obtain second compressed data.
In some embodiments, before compressing the target tuple sequence with the third compression algorithm to obtain second compressed data, the apparatus further comprises:
The same sequence judging unit is used for acquiring a historical binary sequence and judging whether a binary sequence identical to the target binary sequence exists in the historical binary sequence or not;
and the data copying unit is used for directly copying the historical compressed data corresponding to the same binary group sequence as second compressed data if the data exists.
In some embodiments, the third compression unit specifically includes:
The normalization unit is used for performing normalization processing on the target binary sequence to obtain a processed binary sequence;
and the data compression unit is used for compressing the processed binary sequence by using the third compression algorithm to obtain second compressed data.
In some embodiments, the apparatus further comprises:
The command sending unit is used for sending a target command to the monitored hard disk by using a preset system starting controller after the server is electrified and started; the target command is used for controlling the monitored hard disk to send a preset number of data packets with target sizes to the baseboard management controller;
the frequency setting unit is used for counting the average compression time and the average decompression time of the data packets with the preset number of target sizes through the system starting controller, and determining a larger value from the average compression time and the average decompression time so as to set the frequency parameter of the monitored hard disk output hard disk log data by using the larger value.
Referring to fig. 11, an embodiment of the present application discloses a hard disk monitoring device, which is applied to a monitored hard disk, and includes:
The data compression module 11 is configured to compress hard disk log data based on a preset hybrid compression algorithm to obtain a compressed data packet, and send the compressed data packet to the baseboard management controller;
An information determining module 12, configured to determine compression information corresponding to the compressed data packet; the compression information comprises a target compression algorithm and target parameters, wherein the target compression algorithm is at least one compression algorithm in the preset hybrid compression algorithm, and the target parameters are parameters generated in the process of compressing the hard disk log data by using the target compression algorithm;
And the information sending module 13 is configured to send the compressed information to a baseboard management controller, so that the baseboard management controller determines a corresponding decompression algorithm based on the compressed information, and decompresses the compressed data packet by using the decompression algorithm to obtain the hard disk log data, so as to monitor the monitored hard disk based on the hard disk log data.
The beneficial effects are that: in the application, the monitored hard disk can compress the hard disk log data and then send the compressed data packet to the baseboard management controller, and the speed and efficiency of transmitting the data to the outside of the monitored hard disk can be improved through data compression. When the data compression is executed, the method specifically adopts the preset hybrid compression algorithm to compress the hard disk log data so as to further improve the data compression efficiency, so that the monitored hard disk can transmit more hard disk log data in a shorter time, and for the condition of different data packets, the method does not need to compress the data by using all compression algorithms in the preset hybrid compression algorithm, but can pertinently execute corresponding compression steps on different hard disk log data by using a target compression algorithm, wherein the target compression algorithm is at least one compression algorithm in the preset hybrid compression algorithm. In addition, the target parameters generated in the process of compressing the hard disk log data by using the target compression algorithm are also sent to the baseboard management controller, so that the baseboard management controller can rapidly determine the corresponding decompression algorithm according to the compression information when decompressing the compressed data packet, the decompression efficiency of the compressed data packet can be improved, and the out-of-band monitoring of the monitored hard disk is realized based on the hard disk log data obtained by decompression. Through the scheme, the application also realizes high-efficiency and reliable out-of-band monitoring on the basis of improving the efficiency of transmitting the hard disk log data by the hard disk.
Fig. 12 is a schematic structural diagram of an electronic device according to an embodiment of the present application. Specifically, the method comprises the following steps: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input output interface 25, and a communication bus 26. Wherein the memory 22 is configured to store a computer program that is loaded and executed by the processor 21 to implement relevant steps in the hard disk monitoring method performed by the electronic device as disclosed in any of the foregoing embodiments.
In this embodiment, the power supply 23 is configured to provide an operating voltage for each hardware device on the electronic device; the communication interface 24 can create a data transmission channel between the electronic device and the external device, and the communication protocol to be followed is any communication protocol applicable to the technical solution of the present application, which is not limited herein in detail; the input/output interface 25 is used for acquiring external input data or outputting external output data, and the specific interface type thereof may be selected according to the specific application requirement, which is not limited herein.
Processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 may be implemented in at least one hardware form of DSP (DIGITAL SIGNAL Processing), FPGA (Field-Programmable gate array), PLA (Programmable Logic Array ). The processor 21 may also include a main processor, which is a processor for processing data in an awake state, also called a CPU (Central Processing Unit ), and a coprocessor; a coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 21 may integrate a GPU (Graphics Processing Unit, image processor) for rendering and drawing of content required to be displayed by the display screen. In some embodiments, the processor 21 may also include an AI (ARTIFICIAL INTELLIGENCE ) processor for processing computing operations related to machine learning.
The memory 22 may be a carrier for storing resources, such as a read-only memory, a random access memory, a magnetic disk, or an optical disk, and the resources stored thereon include an operating system 221, a computer program 222, and data 223, and the storage may be temporary storage or permanent storage.
The operating system 221 is used for managing and controlling various hardware devices on the electronic device and the computer program 222, so as to implement the operation and processing of the processor 21 on the mass data 223 in the memory 22, which may be Windows, unix, linux. The computer program 222 may further include a computer program that can be used to perform other specific tasks in addition to the computer program that can be used to perform the hard disk monitoring method performed by the electronic device as disclosed in any of the previous embodiments. The data 223 may include, in addition to data received by the electronic device and transmitted by the external device, data collected by the input/output interface 25 itself, and so on.
Further, the embodiment of the application also discloses a computer readable storage medium, wherein the storage medium stores a computer program, and when the computer program is loaded and executed by a processor, the steps of the hard disk monitoring method disclosed in any embodiment are realized.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, so that the same or similar parts between the embodiments are referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative elements and steps are described above generally in terms of functionality in order to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Those skilled in the art may implement the described functionality using different approaches for each particular application, but such implementation is not intended to be limiting.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. The software modules may be disposed in random access Memory (Random Access Memory, i.e., RAM), memory, read-Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a compact disc Read-Only Memory (Compact Disc Read-Only Memory, i.e., CD-ROM), or any other form of storage medium known in the art.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above description of the method, the device, the equipment and the storage medium for monitoring the hard disk provided by the invention applies specific examples to illustrate the principle and the implementation of the invention, and the above examples are only used for helping to understand the method and the core idea of the invention; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present invention, the present description should not be construed as limiting the present invention in view of the above.

Claims (20)

1. A method for monitoring a hard disk, applied to a baseboard management controller, comprising:
Obtaining a compressed data packet corresponding to hard disk log data of a monitored hard disk; the compressed data packet is a data packet obtained by compressing the hard disk log data based on a preset hybrid compression algorithm;
Acquiring compression information corresponding to the compression data packet; the compression information comprises a target compression algorithm and target parameters, wherein the target compression algorithm is at least one compression algorithm in the preset hybrid compression algorithm, and the target parameters are parameters generated in the process of compressing the hard disk log data by using the target compression algorithm;
And determining a corresponding decompression algorithm based on the compression information, and decompressing the compression data packet by using the decompression algorithm to obtain the hard disk log data so as to monitor the monitored hard disk based on the hard disk log data.
2. The method of claim 1, wherein the target compression algorithm is a first compression algorithm of the preset hybrid compression algorithms; the first compression algorithm is used for performing text matching on the current stored data and the historical stored data in the constructed hash table so as to output unmatched text and a target binary sequence according to a text matching result.
3. The method of claim 2, wherein the process of compressing the hard disk log data using the target compression algorithm comprises:
constructing the hash table and dividing the hard disk log data into at least one character string;
And sequentially storing the at least one character string into the hash table based on the first compression algorithm until the last character string is stored into the hash table, and outputting a corresponding unmatched text and a target tuple sequence to obtain the compressed data packet based on the unmatched text and the target tuple sequence.
4. The method of claim 3, wherein storing the at least one string in the hash table based on the first compression algorithm comprises:
judging whether a text match exists between a first character string which is currently stored and a history character string which is already stored in the hash table;
if the first character string and the history character string are not matched in text, storing the first character string into a preset unmatched text; if a second character string is matched with the first character string in the history character strings, confirming the text matching length, and judging whether the text matching length exceeds a first preset threshold value or not;
If the text matching length does not exceed the first preset threshold value, storing the first character string into the unmatched text; if the text matching length exceeds the first preset threshold, outputting a corresponding target binary group sequence, and storing characters, which are not matched with the second character string, in the first character string into the unmatched text; wherein; the target tuple sequence includes the text matching length and an initial character position of the second string.
5. The method for monitoring a hard disk according to claim 2, wherein the preset hybrid compression algorithm further comprises a second compression algorithm and a third compression algorithm;
correspondingly, the process of compressing the hard disk log data based on the preset hybrid compression algorithm comprises the following steps:
when the size of the hard disk log data meets a second preset threshold value, compressing the hard disk log data by using the first compression algorithm to output a corresponding unmatched text and a target binary group sequence;
determining the repetition times of each character in the unmatched text to determine the maximum repetition times, and compressing the unmatched text by using the second compression algorithm and/or the third compression algorithm to obtain first compression data under the condition that the maximum repetition times are different from the total text length of the unmatched text;
Under the condition that the values of the sequences in the target binary group sequence are not the same values, the third compression algorithm is utilized to compress the target binary group sequence to obtain second compressed data;
And obtaining the compressed data packet based on the first compressed data and the second compressed data, and recording the compression algorithm used this time to obtain the target compression algorithm.
6. The method for monitoring a hard disk according to claim 5, wherein, when the maximum number of repetitions is different from the total text length of the unmatched text, compressing the unmatched text by using the second compression algorithm and/or the third compression algorithm to obtain first compressed data includes:
judging whether the maximum repetition number and the text total length meet a preset condition or not under the condition that the maximum repetition number and the text total length of the unmatched text are different;
If the maximum repetition number and the total text length meet the preset conditions, compressing the unmatched text by using the second compression algorithm to obtain initial compressed data, and then compressing the initial compressed data by using the third compression algorithm to obtain first compressed data;
And if the maximum repetition number and the total text length do not meet the preset conditions, compressing the unmatched text by using the third compression algorithm to obtain first compressed data.
7. The method for monitoring a hard disk according to claim 6, wherein the determining whether the maximum number of repetitions and the total text length satisfy a preset condition comprises:
judging whether the maximum repetition number is smaller than or equal to the sum of the total text length and a preset non-zero numerical value;
And if the maximum repetition number is smaller than or equal to the sum of the total text length and a preset non-zero value, judging that the maximum repetition number and the total text length meet the preset condition, otherwise, judging that the maximum repetition number and the total text length do not meet the preset condition.
8. The method for monitoring a hard disk according to claim 5, further comprising:
If the maximum repetition number is the same as the total text length, directly outputting text tuple information and taking the text tuple information as the target parameter, and then prohibiting the step of compressing the unmatched text by using the second compression algorithm and/or the third compression algorithm to obtain first compressed data; wherein the text tuple information includes character information of the unmatched text and the total text length.
9. The method for monitoring a hard disk according to claim 5, further comprising:
If the values of the sequences in the target binary sequence are the same, directly outputting numerical information and the number of the binary groups, taking the numerical information and the number of the binary groups as the target parameters, and prohibiting the step of compressing the target binary sequence by using the third compression algorithm to obtain second compressed data.
10. The method for monitoring a hard disk according to claim 5, wherein before compressing the target tuple sequence by the third compression algorithm to obtain second compressed data, further comprising:
Acquiring a historical binary sequence, and judging whether a binary sequence identical to the target binary sequence exists in the historical binary sequence;
if the data exists, the historical compressed data corresponding to the same binary group sequence is directly copied to be used as second compressed data.
11. The method for monitoring a hard disk according to claim 5, wherein compressing the target tuple sequence by the third compression algorithm to obtain second compressed data comprises:
Normalizing the target binary sequence to obtain a processed binary sequence;
and compressing the processed binary sequence by using the third compression algorithm to obtain second compressed data.
12. The method for monitoring a hard disk according to claim 1, wherein the baseboard management controller is connected to a hard disk pin of the monitored hard disk through a first signal line;
correspondingly, the obtaining the compressed data packet corresponding to the hard disk log data of the monitored hard disk includes:
Acquiring a first output signal of the hard disk pin through the first signal line; the first output signal is a signal obtained by compressing hard disk log data of the monitored hard disk based on a preset hybrid compression algorithm to obtain a compressed data packet, and modulating an initial output signal of the hard disk pin according to the compressed data packet;
Demodulating the first output signal to obtain the compressed data packet.
13. The method for monitoring a hard disk according to claim 1, wherein the baseboard management controller is connected to a complex programmable logic device through a second signal line, and the complex programmable logic device is connected to a hard disk pin of the monitored hard disk through a third signal line;
correspondingly, the obtaining the compressed data packet corresponding to the hard disk log data of the monitored hard disk includes:
Obtaining a compressed data packet which is obtained after the complex programmable logic device demodulates the second output signal of the hard disk pin and is sent through the second signal line; the complex programmable logic device obtains a second output signal of the hard disk pin by using the third signal line, wherein the second output signal is a signal obtained by compressing hard disk log data of the monitored hard disk based on a preset hybrid compression algorithm to obtain a compressed data packet, and modulating an initial output signal of the hard disk pin according to the compressed data packet.
14. The method for monitoring a hard disk according to claim 1, wherein the baseboard management controller is connected to a complex programmable logic device through a second signal line, and the complex programmable logic device is connected to a hard disk pin of the monitored hard disk through a third signal line;
correspondingly, the obtaining the compressed data packet corresponding to the hard disk log data of the monitored hard disk includes:
Obtaining a compressed data packet which is obtained after the complex programmable logic device compresses hard disk log data by using a preset hybrid compression algorithm and is sent through the second signal line; the complex programmable logic device obtains a third output signal of the hard disk pin by using the third signal wire, demodulates the third output signal to obtain the hard disk log data, and the third output signal is a signal obtained after the monitored hard disk modulates the initial output signal of the hard disk pin according to the hard disk log data.
15. The hard disk monitoring method according to any one of claims 1 to 14, further comprising:
After the server is powered on and started, a preset system starting controller is utilized to send a target command to the monitored hard disk; the target command is used for controlling the monitored hard disk to send a preset number of data packets with target sizes to the baseboard management controller;
And counting the average compression time and the average decompression time of the data packets with the preset number of target sizes by the system starting controller, and determining a larger value from the average compression time and the average decompression time so as to set the frequency parameter of the monitored hard disk output hard disk log data by using the larger value.
16. The hard disk monitoring method is characterized by being applied to a monitored hard disk and comprising the following steps of:
Compressing hard disk log data based on a preset hybrid compression algorithm to obtain a compressed data packet, and sending the compressed data packet to a baseboard management controller;
determining compression information corresponding to the compressed data packet; the compression information comprises a target compression algorithm and target parameters, wherein the target compression algorithm is at least one compression algorithm in the preset hybrid compression algorithm, and the target parameters are parameters generated in the process of compressing the hard disk log data by using the target compression algorithm;
And sending the compressed information to a baseboard management controller so that the baseboard management controller determines a corresponding decompression algorithm based on the compressed information, and decompressing the compressed data packet by using the decompression algorithm to obtain the hard disk log data so as to monitor the monitored hard disk based on the hard disk log data.
17. A hard disk monitoring device, applied to a baseboard management controller, comprising:
The compressed data acquisition module is used for acquiring compressed data packets corresponding to the hard disk log data of the monitored hard disk; the compressed data packet is a data packet obtained by compressing the hard disk log data based on a preset hybrid compression algorithm;
the information reading module is used for acquiring compression information corresponding to the compression data packet; the compression information comprises a target compression algorithm and target parameters, wherein the target compression algorithm is at least one compression algorithm in the preset hybrid compression algorithm, and the target parameters are parameters generated in the process of compressing the hard disk log data by using the target compression algorithm;
And the decompression module is used for determining a corresponding decompression algorithm based on the compression information, and decompressing the compression data packet by using the decompression algorithm to obtain the hard disk log data so as to monitor the monitored hard disk based on the hard disk log data.
18. A hard disk monitoring device, applied to a monitored hard disk, comprising:
The data compression module is used for compressing the hard disk log data based on a preset hybrid compression algorithm to obtain a compressed data packet, and sending the compressed data packet to the baseboard management controller;
The information determining module is used for determining compression information corresponding to the compression data packet; the compression information comprises a target compression algorithm and target parameters, wherein the target compression algorithm is at least one compression algorithm in the preset hybrid compression algorithm, and the target parameters are parameters generated in the process of compressing the hard disk log data by using the target compression algorithm;
And the information sending module is used for sending the compressed information to a baseboard management controller so that the baseboard management controller can determine a corresponding decompression algorithm based on the compressed information, and decompress the compressed data packet by using the decompression algorithm to obtain the hard disk log data so as to monitor the monitored hard disk based on the hard disk log data.
19. An electronic device, comprising:
A memory for storing a computer program;
A processor for executing the computer program to implement the steps of the hard disk monitoring method as claimed in any one of claims 1 to 16.
20. A computer-readable storage medium storing a computer program; wherein the computer program when executed by a processor implements the steps of the hard disk monitoring method according to any one of claims 1 to 16.
CN202410382656.8A 2024-03-29 2024-03-29 Hard disk monitoring method, device, equipment and medium Active CN117971612B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410382656.8A CN117971612B (en) 2024-03-29 2024-03-29 Hard disk monitoring method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410382656.8A CN117971612B (en) 2024-03-29 2024-03-29 Hard disk monitoring method, device, equipment and medium

Publications (2)

Publication Number Publication Date
CN117971612A true CN117971612A (en) 2024-05-03
CN117971612B CN117971612B (en) 2024-06-04

Family

ID=90865050

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410382656.8A Active CN117971612B (en) 2024-03-29 2024-03-29 Hard disk monitoring method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN117971612B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102831020A (en) * 2012-07-26 2012-12-19 中国科学院信息工程研究所 Log detection method and system
CN115643310A (en) * 2022-09-26 2023-01-24 建信金融科技有限责任公司 Method, device and system for compressing data
WO2023000674A1 (en) * 2021-07-23 2023-01-26 苏州浪潮智能科技有限公司 Method and apparatus for data compression, backup and recovery of cloud hard disk, device and storage medium
CN117251333A (en) * 2023-09-26 2023-12-19 浪潮(山东)计算机科技有限公司 Method, device, equipment and storage medium for acquiring hard disk information

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102831020A (en) * 2012-07-26 2012-12-19 中国科学院信息工程研究所 Log detection method and system
WO2023000674A1 (en) * 2021-07-23 2023-01-26 苏州浪潮智能科技有限公司 Method and apparatus for data compression, backup and recovery of cloud hard disk, device and storage medium
CN115643310A (en) * 2022-09-26 2023-01-24 建信金融科技有限责任公司 Method, device and system for compressing data
CN117251333A (en) * 2023-09-26 2023-12-19 浪潮(山东)计算机科技有限公司 Method, device, equipment and storage medium for acquiring hard disk information

Also Published As

Publication number Publication date
CN117971612B (en) 2024-06-04

Similar Documents

Publication Publication Date Title
CN108650287B (en) Upgrading method and device for terminal device in Internet of things and computer readable medium
US8751635B2 (en) Monitoring sensors for systems management
US8898345B2 (en) Out-of-band management of third party adapter configuration settings in a computing system
CN110928561B (en) Vehicle controller software version management method and device, vehicle and storage medium
US8793364B1 (en) Remote power controller
CN111694684B (en) Abnormal construction method and device of storage device, electronic device and storage medium
CN117971612B (en) Hard disk monitoring method, device, equipment and medium
US8280930B1 (en) Obtaining configuration information from host devices which store data into and load data from a data storage array
US9513821B2 (en) Apparatus and method for indicating flash memory life
CN111594476B (en) Control method and device for fan error-reporting lamp of server and storage medium
CN112463067A (en) Data protection method and equipment in NVMe-oF scene
CN115934616A (en) Serial port information storage method and device, server, electronic equipment and storage medium
CN117971610B (en) Hard disk monitoring method, device, system, equipment and storage medium
CN111193818A (en) Method, system, equipment and medium for obtaining IP address
CN117971607B (en) Hard disk monitoring method, device, equipment and medium
US20130080669A1 (en) Dynamically Determining A Primary Or Slave Assignment Based On An Order Of Cable Connection Between Two Devices
CN111610935B (en) Access control method, device, equipment and medium
CN116881091B (en) System event log reporting method, device, chip, equipment and storage medium
US20230305908A1 (en) Hardware event messages
CN117992311B (en) Server and hard disk monitoring method, device, equipment and medium thereof
US9479565B2 (en) Selecting a network connection for data communications with a networked device
CN117033119A (en) Data acquisition method and device, electronic equipment and computer readable medium
CN117708150A (en) Erasure code data updating method and device
CN118093320A (en) Method and device for monitoring processor information, storage medium and electronic equipment
US20210141563A1 (en) Data storage device capable of self-accessing data file

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
GR01 Patent grant
GR01 Patent grant