Fault message positioning method and device, computer equipment and storage medium
By obtaining the index and status code of the reply message in the shared memory of the server, and using the preset correspondence relationship to accurately locate the service of the SAS protocol fault message, the problem of difficulty in positioning the SAS protocol fault message is solved, and the fault resolution efficiency is improved. Reduced costs.
Patent Information
- Application Number
- CN202410972529.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-19
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2044-07-19
AI Technical Summary
In network communication based on SAS protocol, fault message location is difficult, resulting in a long fault resolution cycle, affecting customer experience and increasing costs.
By obtaining the index and status code of the reply message in the shared memory of the server, the preset correspondence relationship is used to determine whether the fault message exists, and accurately locate the services corresponding to the fault message based on the service number and the service mapping table.
It realizes rapid identification and location of fault messages, shortens the time to resolve faults, improves customer experience and reduces location costs.
Smart Images

Figure CN118984267A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of network communication technology, and in particular to a method, device, computer equipment and storage medium for locating a fault message. Background Art
[0002] With the rapid development of digitalization and intelligence, all businesses are increasingly moving towards intelligence and precision. The premise of intelligence and digitalization is to collect a large amount of data. In this process, in addition to relying on increasingly powerful computing power, high-speed and reliable data storage and reading hardware or software support is also required. For example, the Linux system supports high-speed reading and writing of the Serial Attached SCSI (SAS) protocol or SAS disk.
[0003] Due to the complex and trivial nature of the underlying protocol interface, once a fault occurs during the transmission of protocol messages based on the SAS protocol, the protocol message at the time of the fault is usually captured (with a high probability that the point where the error occurred has been missed) and fed back to the back-end R&D personnel; the back-end R&D personnel then use various means to analyze, reproduce, and solve the problem. This method relies on strong professional capabilities and cannot accurately locate the business corresponding to the fault message. It will result in the need to start a new round of capture, reproduction, positioning, and solution cycles many times before the problem can be solved, resulting in a long cycle for solving the fault, affecting customer experience, and consuming relatively high costs. Summary of the invention
[0004] In view of this, the present invention provides a method, apparatus, computer device and storage medium for locating a fault message to solve the problem of being unable to accurately locate the service corresponding to the fault message.
[0005] In a first aspect, the present invention provides a method for locating a fault message, the method comprising: when a reply message is a response message generated for a SAS protocol message, receiving an index of a reply message sent from a collection device, the SAS protocol message being sent by a server to a hard disk when a service needs to be executed; based on the index of the reply message, obtaining the reply message, and determining a service number corresponding to the SAS protocol message in a shared memory of the server, the reply message carrying a status code; determining whether the SAS protocol message is a fault message based on the status code and a preset corresponding relationship; if so, locating the service corresponding to the SAS protocol message based on the service number and a service mapping table in the shared memory, the service mapping table comprising multiple services and a service number corresponding to each service.
[0006] Based on the method provided in the first aspect above, when the reply message is a response message generated for a SAS protocol message, an index of the reply message sent from the collection device can be received, and based on the index of the reply message, the reply message can be obtained in the shared memory of the server, and the service number corresponding to the SAS protocol message can be determined, and whether the SAS protocol message is a fault message can be determined based on the status code and the preset correspondence; if so, the service corresponding to the SAS protocol message can be located based on the service number and the service mapping table in the shared memory.
[0007] Since the reply message is a response message generated for the SAS protocol message, the reply message can be obtained in the shared memory of the server according to the index of the reply message, and the business number corresponding to the SAS protocol message associated with the index of the reply message can be determined. This shared memory method can reduce data copying between devices and improve efficiency.
[0008] In addition, based on the status code of the response message and the preset correspondence, it can be determined whether the SAS protocol message corresponding to the response message is a fault message. When it is determined to be a fault message, the service code is determined according to the one-to-one correspondence between the service number and the service mapping table in the shared memory, and then the service corresponding to the SAS protocol message of the fault is accurately located, so that the service identification corresponding to the fault message can be identified with one confirmation, avoiding multiple identifications that lead to long time consumption. This method improves customer experience, shortens the time to locate the service corresponding to the fault message, and thus reduces the location cost.
[0009] In an optional implementation, based on the index of the reply message, a reply message is obtained in a shared memory of the server, and a service number corresponding to the SAS protocol message is determined, including: based on the index of the reply message, a reply message is obtained in a shared memory of the server; among multiple descriptors in the shared memory, a target descriptor including the index of the reply message is screened, the target descriptor being a shared descriptor corresponding to a SAS protocol message and the reply message, and the target descriptor including the service number corresponding to the SAS protocol message.
[0010] Based on the above method, based on the index of the reply message, the target descriptor including the index of the reply message can be determined in the shared memory, and then the service number corresponding to the SAS protocol message can be accurately determined, so as to facilitate the subsequent determination of the service corresponding to the SAS protocol message based on the service number.
[0011] In an optional implementation, the method further includes: determining the cause of the failure of the SAS protocol message according to the status code and the status code conversion table; storing the cause of the failure in a shared memory, and deleting the target descriptor, the SAS protocol message and the response message from the shared memory.
[0012] Based on the above method, the fault cause of the faulty SAS protocol message can be accurately determined based on the status code and the status code conversion table, so as to solve the problem corresponding to the SAS protocol message fault based on the fault cause.
[0013] In a second aspect, the present invention provides a method for locating a fault message, which is applied to a collection device, and the method includes: obtaining a SAS protocol message and an index of the SAS protocol message sent by a server to a hard disk, wherein the SAS protocol message includes a SAS protocol message identifier; receiving a response message sent from the hard disk, and determining whether the response message is a response message generated for the SAS protocol message according to the SAS protocol message identifier and the response message identifier, wherein the response message includes the response message identifier;
[0014] If so, the index of the reply message is sent to the analysis device, which is used to locate the service number corresponding to the SAS protocol message in the shared memory of the server and obtain the reply message based on the index of the reply message, and determine whether the SAS protocol message is a fault message and locate the service corresponding to the SAS protocol message based on the service number and the reply message.
[0015] Based on the method provided in the second aspect above, the SAS protocol message sent by the server to the hard disk and the index of the SAS protocol message can be obtained; a reply message sent from the hard disk is received, and according to the SAS protocol message identifier and the reply message identifier, it is determined whether the reply message is a response message generated for the SAS protocol message; if so, the index of the reply message is sent to the analysis device, and the analysis device is used to locate the service number corresponding to the SAS protocol message in the shared memory of the server based on the index of the reply message and obtain the reply message, and according to the service number and the reply message, determine whether the SAS protocol message is a fault message and locate the service corresponding to the SAS protocol message.
[0016] Since it is possible to determine whether the reply message is a response message generated for the SAS protocol message based on the SAS protocol message identifier and the reply message identifier, that is, first determine whether the reply message matches the SAS protocol message. If it matches, send the index of the reply message to the analysis device, so that the analysis device can determine whether the SAS protocol message is a fault message and locate the business corresponding to the SAS protocol message, thereby avoiding the problem of long fault resolution cycle caused by multiple fault message locating and its corresponding business, improving customer experience and reducing the cost of locating fault messages.
[0017] In an optional implementation, the shared memory includes a protocol area, and the protocol area is used to store messages. The method further includes: copying the SAS protocol message to a corresponding position in the protocol area according to an index of the SAS protocol message.
[0018] Based on the above method, the SAS protocol message can be stored in the corresponding position of the protocol area, which is convenient for subsequent acquisition of the SAS protocol message and parsing it to obtain the corresponding message.
[0019] In an optional embodiment, the shared memory also includes a configuration area, receives a reply message sent from the hard disk, and determines whether the reply message is a response message generated for the SAS protocol message based on the SAS protocol message identifier and the reply message identifier, including: obtaining the business number corresponding to the SAS protocol message; allocating a first descriptor to the SAS protocol message in the configuration area, the first descriptor including the SAS protocol message identifier, the index of the SAS protocol message and the business number corresponding to the SAS protocol message; receives the reply message sent from the hard disk, and according to the index of the reply message, copies the reply message to the corresponding position of the protocol area; according to the reply message identifier, searches in the configuration area whether there is a SAS protocol message identifier included in the descriptor that is consistent with the reply message identifier.
[0020] If yes, it is determined that the reply message is a response message generated for the SAS protocol message, the reply message identifier and the reply message index are stored in the first descriptor, and the target descriptor corresponding to the SAS protocol message and the reply message is obtained.
[0021] Based on the above method, it is possible to search in the configuration area whether the SAS protocol message identifier included in the descriptor is consistent with the reply message identifier according to the reply message identifier, and then determine whether the reply message is a response message generated for the SAS protocol message. And in the case where the reply message is a response message generated for the SAS protocol message, the first descriptor is updated to obtain the target descriptor, so as to facilitate the subsequent sending of the reply message identifier in the target descriptor to the analysis device.
[0022] In a third aspect, the present invention provides an analysis device, which includes: a transceiver module, which is used to receive an index of a reply message sent from a collection device when the reply message is a response message generated for a SAS protocol message, and the SAS protocol message is sent by a server to a hard disk; a processing module, which is used to obtain the reply message in a shared memory of a server based on the index of the reply message, and determine the service number corresponding to the SAS protocol message, and the reply message carries a status code; the processing module is also used to determine whether the SAS protocol message is a fault message based on the status code and a preset correspondence; the processing module is also used to locate the service corresponding to the SAS protocol message based on the service number and the service mapping table in the shared memory if so, and the service mapping table includes multiple services and the service number corresponding to each service.
[0023] In a fourth aspect, the present invention provides a collection device, which includes: a transceiver module, which is used to obtain a SAS protocol message and an index of the SAS protocol message sent by a server to a hard disk, wherein the SAS protocol message includes a SAS protocol message identifier; a processing module, which is used to receive a reply message sent from the hard disk, and determine whether the reply message is a response message generated for the SAS protocol message based on the SAS protocol message identifier and the reply message identifier, and the reply message includes a reply message identifier; the transceiver module is also used to send the index of the reply message to an analysis device if so, and the analysis device is used to locate the service number corresponding to the SAS protocol message in the shared memory of the server based on the index of the reply message and obtain the reply message, and determine whether the SAS protocol message is a fault message and locate the service corresponding to the SAS protocol message based on the service number and the reply message.
[0024] In a fifth aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, computer instructions are stored in the memory, and the processor executes the fault message locating method of the above-mentioned first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0025] In a sixth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method for locating a fault message of the first aspect or any corresponding embodiment thereof.
[0026] In a seventh aspect, the present application also provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the methods described in the above aspects. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0028] Figure 1 is a schematic diagram of the architecture of a fault message locating system 10 according to an embodiment of the present invention;
[0029] Figure 2 is a schematic diagram of a shared memory according to an embodiment of the present invention;
[0030] Figure 3 It is a flowchart of a method for locating a fault message according to an embodiment of the present invention;
[0031] Figure 4 is a flow chart of another method for locating a fault message according to an embodiment of the present invention;
[0032] Figure 5 is a flow chart of another method for locating a fault message according to an embodiment of the present invention;
[0033] Figure 6 is a structural block diagram of an analysis device according to an embodiment of the present invention;
[0034] Figure 7 is a structural block diagram of a collection device according to an embodiment of the present invention;
[0035] Figure 8 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0036] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0037] As described in the background technology, during the protocol message transmission process based on the SAS protocol, once a fault occurs, it is necessary to repeat the message capture, reproduction, location, and resolution cycles multiple times to locate the business corresponding to the faulty message, resulting in a long fault resolution cycle, affecting customer experience, and consuming relatively high costs.
[0038] In order to solve the above problems, an embodiment of the present invention provides a method for locating a fault message, which is applied to an analysis device. The method includes receiving an index of a reply message sent from a collection device when the reply message is a response message generated for a SAS protocol message, and the SAS protocol message is sent by a server to a hard disk; based on the index of the reply message, obtaining the reply message in the shared memory of the server, and determining the service number corresponding to the SAS protocol message, and the reply message carries a status code; determining whether the SAS protocol message is a fault message according to the status code and the preset correspondence; if so, locating the service corresponding to the SAS protocol message based on the service number and the service mapping table in the shared memory, and the service mapping table includes multiple services and the service number corresponding to each service. This method can accurately locate the service corresponding to the fault message, shorten the cycle of solving the fault message, improve customer experience, and reduce costs.
[0039] like Figure 1 As shown, Figure 12 is a schematic diagram of the architecture of a fault message locating system 10 according to an embodiment of the present invention. Figure 1 In the present invention, the fault message positioning system 10 may include an analysis device 101, a collection device 102, a server 103, a shared memory 104 and a hard disk 105. Figure 1 In the shared memory, storage services can be provided for analysis devices, collection devices, and servers.
[0040] The analysis device in the embodiment of the present application, for example, the analysis device 101, can be any device having computing and communication functions. The analysis device can include a receiving module, a display module, and an analysis module. The receiving module is used to receive information from the collection device. The display module is used to display the alarm information or the cause of the fault after being processed by the analysis module. The analysis module is used to locate the service corresponding to the fault message and analyze the cause of the fault message.
[0041] The collecting device in the embodiment of the present application, for example, the collecting device 102, is a device with wireless transceiver function. The collecting device is used to collect protocol messages or other information of points that need to be collected, such as the kernel layer, the kernel driver layer, and the application layer.
[0042] The server in the embodiment of the present application, for example, the server 103, is a device with computing and communication functions, including but not limited to a cloud server, a tower server, and the like.
[0043] The shared memory in the embodiment of the present application, for example, shared memory 104, is a relatively large continuous physical address that is separately allocated and mapped when the server kernel starts. The shared memory is functionally divided into a configuration area and a message protocol area (also called a protocol area). The configuration area and the message protocol area are allocated in a default ratio of 1:9 based on the total byte size of the shared memory. It is understandable that the ratio can be set according to actual needs without limitation. Figure 2 As shown, Figure 2 1 is a schematic diagram of a shared memory according to an embodiment of the present invention; the configuration area is used to store a service mapping table and a descriptor; and the message protocol area is used to store multiple messages.
[0044] For the configuration area, the server reads the configuration file and maintains a global business mapping table in the configuration area. All services need to be reflected in this business mapping table. It can be understood that the level of detail of the mapping table business determines the specific level of business that can be achieved in error positioning. The server calculates the maximum number of descriptors that the configuration area can support based on the size of the allocated message protocol area. When the descriptor is filled, the descriptor is repeatedly saved by re-covering the header. The configuration area includes a dedicated descriptor to record the repeatedly saved descriptors.
[0045] For the message protocol area, the message protocol area stores paired protocol messages (SAS protocol messages and response messages). Similarly, after the protocol message area is fully filled, the server repetitively saves the message by re-covering the header.
[0046] For shared memory, the server starts a periodic timer to check whether the message saved in the message protocol area is within the validity period. If not, a message is sent to the analysis device.
[0047] The hard disk in the embodiment of the present application, for example, the hard disk 105, is any hard disk with a storage function, including but not limited to a mechanical hard disk, a solid state hard disk, a hybrid hard disk, and the like.
[0048] Figure 1 The fault message location system 10 shown is only used as an example and is not used to limit the technical solution of the present application. Those skilled in the art should understand that in the specific implementation process, the fault message location system 10 can also include other devices, and the number of hard disks can also be determined according to specific needs without limitation.
[0049] According to an embodiment of the present invention, an embodiment of a method for locating a fault message is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0050] In this embodiment, a method for locating a fault message is provided, which can be used in the above-mentioned collection device. Figure 3 FIG. 1 is a flow chart of a method for locating a fault message according to an embodiment of the present invention. Figure 3 As shown, the process includes the following steps:
[0051] S301: Acquire a SAS protocol message and an index of the SAS protocol message sent by a server to a hard disk.
[0052] The SAS protocol message is a message for data transmission based on the SAS protocol. The SAS protocol message includes a SAS protocol message identifier. For example, the SAS protocol message identifier is an identifier of a protocol sequence number, SEQID.
[0053] In the embodiment of the present invention, the index of the SAS protocol message is the storage address of the SAS protocol message in the protocol area in the shared memory.
[0054] It is understandable that the SAS protocol message is sent by the server to the hard disk when a service needs to be executed. After receiving the SAS protocol message, the hard disk will return a response message, and obtain the service information that needs to be executed by the hard disk according to the received SAS protocol message, and execute the service corresponding to the SAS protocol message.
[0055] In one example, when a server sends a SAS protocol message to a hard disk, a collection device obtains the SAS protocol message sent by the server to the hard disk, allocates a first descriptor to the SAS protocol message in a configuration area, and obtains an index of the SAS protocol message.
[0056] It can be understood that when the server sends multiple SAS protocol messages to the hard disk, the collection device obtains multiple SAS protocol messages sent by the server to the hard disk, and allocates multiple descriptors to the SAS protocol messages in the configuration area in a forward-to-backward order to obtain indexes of the multiple SAS protocol messages.
[0057] S302: receiving a reply message sent from the hard disk, and determining whether the reply message is a response message generated for the SAS protocol message according to the SAS protocol message identifier and the reply message identifier.
[0058] The response message includes a response message identifier.
[0059] In some optional embodiments, the collection device obtains the service number corresponding to the SAS protocol message; allocates a first descriptor to the SAS protocol message in the configuration area; receives a response message sent from the hard disk; and based on the response message identifier, searches in the configuration area whether there is a SAS protocol message identifier included in the descriptor that is consistent with the response message identifier.
[0060] If so, the collection device determines that the reply message is a response message generated for the SAS protocol message, stores the reply message identifier and the reply message index in the first descriptor, obtains the target descriptor corresponding to the SAS protocol message and the reply message, and copies the reply message to the corresponding position in the protocol area according to the reply message index.
[0061] The first descriptor includes a SAS protocol message identifier, an index of the SAS protocol message, and a service number corresponding to the SAS protocol message.
[0062] In the embodiment of the present invention, the target descriptor includes a SAS protocol message identifier, an index of the SAS protocol message, a service number corresponding to the SAS protocol message, a response message identifier, and an index of the response message.
[0063] In one example, when a server sends a SAS protocol message to a hard disk, a collection device obtains a service number corresponding to the SAS protocol message in a configuration area of a shared memory.
[0064] In some optional implementations, the collection device copies the SAS protocol message to a corresponding position in the protocol area according to an index of the SAS protocol message.
[0065] Optionally, the collection device searches the configuration area for a SAS protocol message identifier that does not exist in the descriptor consistent with the reply message identifier based on the reply message identifier, then determines that the reply message is not a response message generated for the SAS protocol message, and allocates a second descriptor to the reply message in the configuration area.
[0066] The second descriptor includes a response message identifier, an index of the response message, and a response service number of the response message.
[0067] It can be understood that the collection device determines that the reply message is not a response message generated for the SAS protocol message, which means that the reply message may be an invalid message or a reply message of other SAS protocol messages. In this case, it is necessary to store the reply message identifier, the reply message index and the reply service number of the reply message in the second descriptor to facilitate subsequent judgment of whether other SAS protocol messages are fault messages.
[0068] S203: If yes, send the index of the response message to the analysis device.
[0069] Among them, the analysis device is used to locate the service number corresponding to the SAS protocol message in the shared memory of the server and obtain the reply message based on the index of the reply message, and determine whether the SAS protocol message is a fault message and locate the service corresponding to the SAS protocol message according to the service number and the reply message.
[0070] It can be understood that the relevant information of the response message and the SAS protocol message are all stored in the same descriptor, so that the subsequent analysis device can determine the target descriptor according to the index of the response message and then find the service code corresponding to the SAS protocol message.
[0071] Based on the above S201-S203, the collection device can receive the index of the reply message sent from the collection device when the reply message is a response message generated for the SAS protocol message, obtain the reply message in the shared memory of the server based on the index of the reply message, and determine the service number corresponding to the SAS protocol message, and determine whether the SAS protocol message is a fault message according to the status code and the preset correspondence; if so, locate the service corresponding to the SAS protocol message based on the service number and the service mapping table in the shared memory.
[0072] Since the reply message is a response message generated for the SAS protocol message, the reply message can be obtained in the shared memory of the server according to the index of the reply message, and the business number corresponding to the SAS protocol message associated with the index of the reply message can be determined. This shared memory method can reduce data copying between devices and improve efficiency.
[0073] In addition, based on the status code of the response message and the preset correspondence, it can be determined whether the SAS protocol message corresponding to the response message is a fault message. When it is determined to be a fault message, the service code is determined according to the one-to-one correspondence between the service number and the service mapping table in the shared memory, and then the service corresponding to the SAS protocol message of the fault is accurately located, so that the service identification corresponding to the fault message can be identified with one confirmation, avoiding multiple identifications that lead to long time consumption. This method improves customer experience, shortens the time to locate the service corresponding to the fault message, and thus reduces the location cost.
[0074] In this embodiment, a method for locating a fault message is provided, which can be used in the above-mentioned analysis device. Figure 4 FIG. 1 is a flow chart of a method for locating a fault message according to an embodiment of the present invention. Figure 4 As shown, the process includes the following steps:
[0075] S401: When the reply message is a response message generated for a SAS protocol message, receive an index of the reply message sent from a collection device.
[0076] S402: Based on the index of the response message, obtain the response message in the shared memory of the server, and determine the service number corresponding to the SAS protocol message.
[0077] The response message carries a status code.
[0078] In some optional embodiments, the analysis device obtains the reply message in the shared memory of the server based on the index of the reply message, and determines the service number corresponding to the SAS protocol message, including: obtaining the reply message in the shared memory of the server based on the index of the reply message; and screening the target descriptor including the index of the reply message among multiple descriptors in the shared memory.
[0079] The target descriptor is a shared descriptor corresponding to the SAS protocol message and the response message, and the target descriptor includes the service number corresponding to the SAS protocol message.
[0080] S403: Determine whether the SAS protocol message is a fault message according to the status code and the preset corresponding relationship.
[0081] The status code is the status of the response message. The status code can indicate various states of the SAS protocol message.
[0082] Exemplarily, taking the status code as the first status code, the second status code or the third status code as an example, the preset corresponding relationship includes the first status code corresponding to the SAS protocol message as a fault message, the second status code corresponding to the SAS protocol message as a normal message, and the third status code corresponding to the SAS protocol message as an invalid message.
[0083] It can be understood that the status code may also be more status codes, and different status codes indicate different statuses of SAS protocol messages.
[0084] S404: If yes, locate the service corresponding to the SAS protocol message based on the service number and the service mapping table in the shared memory.
[0085] The service mapping table includes multiple services and a service number corresponding to each service.
[0086] It can be understood that the analysis device matches the corresponding
[0087] In some optional implementations, the analysis device determines the cause of the failure of the SAS protocol message based on the status code and the status code conversion table; stores the cause of the failure in a shared memory, and deletes the target descriptor, the SAS protocol message, and the response message from the shared memory.
[0088] The status code conversion table is used to convert the status code into the fault cause.
[0089] Exemplarily, taking the status code "CHECK_CONDITION error code" as an example, the analysis device converts the "CHECK_CONDITION error code" into the fault cause being illegal command parameters, that is, the sent parameters are wrong, based on the "CHECK_CONDITION error code" and the status code conversion table.
[0090] It can be understood that the analysis device deletes the target descriptor, SAS protocol message and response message from the shared memory, and can reset the target descriptor to an unused state to be allocated to the next message.
[0091] In some optional implementations, the analyzing device obtains a message type of the SAS protocol message, and determines a message content corresponding to the SAS protocol message according to the message type of the SAS protocol message.
[0092] The message type may be a data message type or a management message type.
[0093] It can be understood that if the message type is a data message type, the analysis device determines that the message content corresponding to the SAS protocol message is the SAS protocol message. If the message type is a management message type, the analysis device determines that the message content corresponding to the SAS protocol message is the specific meaning of the message content parsed according to the protocol.
[0094] Similarly, the analysis device obtains the message type of the response message, and determines the message content corresponding to the response message according to the message type of the response message.
[0095] It can be understood that the display module included in the analysis device can display the message content corresponding to the SAS protocol message, the message content corresponding to the response message, the cause of the fault and the business corresponding to the SAS protocol message, so that the management personnel can find the relevant information of the fault message in time.
[0096] Based on the above S401-S404, when the reply message is a response message generated for a SAS protocol message, an index of the reply message sent from the collection device can be received, and based on the index of the reply message, the reply message can be obtained in the shared memory of the server, and the service number corresponding to the SAS protocol message can be determined, and whether the SAS protocol message is a fault message can be determined based on the status code and the preset correspondence; if so, the service corresponding to the SAS protocol message can be located based on the service number and the service mapping table in the shared memory.
[0097] Since the reply message is a response message generated for the SAS protocol message, the reply message can be obtained in the shared memory of the server according to the index of the reply message, and the service number corresponding to the SAS protocol message associated with the index of the reply message can be determined. This shared memory method can reduce data copying between various devices and improve efficiency. In addition, based on the status code and the preset correspondence of the reply message, it can be determined whether the SAS protocol message corresponding to the reply message is a fault message. Since the service number and the service mapping table in the shared memory have a one-to-one correspondence, the service corresponding to the SAS protocol message can be accurately located based on the determined service code, avoiding multiple fault message positioning of the corresponding service, resulting in a long period of troubleshooting, improving customer experience, and reducing the cost of locating fault messages.
[0098] In this embodiment, another method for locating a fault message is provided, such as Figure 5 As shown, Figure 5 FIG. 1 is a flow chart of another method for locating a fault message according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:
[0099] S501: The collection device obtains a SAS protocol message sent by the server to the hard disk and an index of the SAS protocol message in the first descriptor.
[0100] S502: The collection device obtains the service number corresponding to the SAS protocol message.
[0101] S503: The collection device receives a response message sent from the hard disk.
[0102] S504: Determine, according to the SAS protocol message identifier and the response message identifier, whether the response message is a response message generated for the SAS protocol message.
[0103] S505: If yes, the collecting device sends the index of the response message to the analyzing device.
[0104] S506: If not, the collection device allocates a second descriptor for the response message in the configuration area.
[0105] S507: The analysis device receives the index of the response message sent from the collection device.
[0106] S508: The analysis device obtains the response message from the shared memory of the server based on the index of the response message, and determines the service number corresponding to the SAS protocol message.
[0107] S509: The analysis device determines whether the SAS protocol message is a fault message according to the status code and the preset corresponding relationship.
[0108] S510: If yes, the analysis device locates the service corresponding to the SAS protocol message based on the service number and the service mapping table in the shared memory.
[0109] S511: If not, the analysis device deletes the target descriptor, the SAS protocol message and the response message from the shared memory.
[0110] In this embodiment, a fault message positioning device is also provided, which is used to implement the above embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0111] This embodiment provides an analysis device, such as Figure 6 As shown, Figure 6 It is a structural block diagram of an analysis device according to an embodiment of the present invention; it includes: a transceiver module 601, which is used to receive an index of a response message sent from a collection device when the response message is a response message generated for a SAS protocol message, and the SAS protocol message is sent by a server to a hard disk.
[0112] Processing module 602 is used to obtain the response message in the shared memory of the server based on the index of the response message, and determine the service number corresponding to the SAS protocol message, and the response message carries a status code.
[0113] The processing module 602 is further configured to determine whether the SAS protocol message is a fault message according to the status code and the preset corresponding relationship.
[0114] The processing module 602 is further configured to locate the service corresponding to the SAS protocol message based on the service number and the service mapping table in the shared memory if yes, wherein the service mapping table includes multiple services and the service number corresponding to each service.
[0115] In some optional implementations, processing module 602 is specifically used to obtain a response message in a shared memory of a server based on an index of the response message; processing module 602 is also specifically used to filter a target descriptor including an index of the response message from multiple descriptors in the shared memory, the target descriptor being a shared descriptor corresponding to a SAS protocol message and a response message, and the target descriptor including a service number corresponding to the SAS protocol message.
[0116] In some optional implementations, the processing module 602 is also used to determine the fault cause of the SAS protocol message based on the status code and the status code conversion table, and the status code conversion table is used to convert the status code into the fault cause; the processing module 602 is also used to store the fault cause in the shared memory and delete the target descriptor, the SAS protocol message and the response message from the shared memory.
[0117] This embodiment provides a collection device, such as Figure 7 As shown, Figure 7 It is a structural block diagram of a collection device according to an embodiment of the present invention; it includes: a transceiver module 701, which is used to obtain a SAS protocol message and an index of the SAS protocol message sent by a server to a hard disk, wherein the SAS protocol message includes a SAS protocol message identifier.
[0118] The processing module 702 is used to receive a reply message sent from the hard disk, and determine whether the reply message is a response message generated for the SAS protocol message according to the SAS protocol message identifier and the reply message identifier, wherein the reply message includes the reply message identifier.
[0119] The transceiver module 701 is also used to send the index of the reply message to the analysis device if yes, and the analysis device is used to locate the service number corresponding to the SAS protocol message in the shared memory of the server and obtain the reply message based on the index of the reply message, and determine whether the SAS protocol message is a fault message and locate the service corresponding to the SAS protocol message according to the service number and the reply message.
[0120] In some optional implementations, the shared memory includes a protocol area, and the processing module 702 is further configured to copy the SAS protocol message to a corresponding position in the protocol area according to an index of the SAS protocol message.
[0121] In some optional embodiments, the shared memory includes a configuration area, and the processing module 702 is further specifically used to obtain the business number corresponding to the SAS protocol message; the processing module 702 is further specifically used to allocate a first descriptor to the SAS protocol message in the configuration area, and the first descriptor includes a SAS protocol message identifier, an index of the SAS protocol message and a business number corresponding to the SAS protocol message; the processing module 702 is further specifically used to receive a reply message sent from the hard disk, and according to the reply message identifier, search in the configuration area whether there is a SAS protocol message identifier included in the descriptor that is consistent with the reply message identifier; the processing module 702 is further specifically used to determine that the reply message is a response message generated for the SAS protocol message, if so, store the reply message identifier and the index of the reply message in the first descriptor, obtain the SAS protocol message and the target descriptor corresponding to the reply message, and copy the reply message to the corresponding position in the protocol area according to the index of the reply message.
[0122] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0123] The analysis device / collection device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above-mentioned functions.
[0124] The embodiment of the present invention also provides a computer device having the above Figure 6 The analytical device shown or Figure 7 The collection device shown.
[0125] See also Figure 8 , Figure 8 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 8As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 8 A processor 10 is taken as an example.
[0126] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0127] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0128] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0129] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0130] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0131] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0132] Part of the present application may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present application through the operation of the computer. Those skilled in the art should understand that the existence of computer program instructions in computer-readable media includes but is not limited to source files, executable files, installation package files, etc., and accordingly, the way in which computer program instructions are executed by a computer includes but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to the computer.
[0133] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A method for locating a fault message, characterized in that: Applied to an analytical device, the method comprises: In the case where the reply message is a response message generated for a SAS protocol message, receiving an index of the reply message sent from the collection device, wherein the SAS protocol message is sent by the server to the hard disk when a service needs to be executed; Based on the index of the response message, the response message is obtained in the shared memory of the server, and the service number corresponding to the SAS protocol message is determined, and the response message carries a status code; Determine whether the SAS protocol message is a fault message according to the status code and the preset corresponding relationship; If yes, then based on the service number and the service mapping table in the shared memory, the service corresponding to the SAS protocol message is located, where the service mapping table includes multiple services and a service number corresponding to each service.
2. The method according to claim 1, characterized in that The step of obtaining the response message in the shared memory of the server based on the index of the response message and determining the service number corresponding to the SAS protocol message includes: Based on the index of the response message, obtaining the response message in the shared memory of the server; Among the multiple descriptors in the shared memory, a target descriptor including an index of the response message is screened, the target descriptor is a shared descriptor corresponding to the SAS protocol message and the response message, and the target descriptor includes a service number corresponding to the SAS protocol message.
3. The method according to claim 2, characterized in that The method further comprises: Determine the fault cause of the SAS protocol message according to the status code and the status code conversion table, wherein the status code conversion table is used to convert the status code into the fault cause; The fault cause is stored in the shared memory, and the target descriptor, the SAS protocol message and the response message are deleted from the shared memory.
4. A method for locating a fault message, characterized in that: Applied to a collection device, the method comprises: Obtaining a SAS protocol message sent by the server to the hard disk and an index of the SAS protocol message, wherein the SAS protocol message includes a SAS protocol message identifier; Receiving a reply message sent from the hard disk, and determining whether the reply message is a response message generated for the SAS protocol message according to the SAS protocol message identifier and the reply message identifier, wherein the reply message includes the reply message identifier; If so, the index of the reply message is sent to the analysis device, and the analysis device is used to locate the service number corresponding to the SAS protocol message in the shared memory of the server and obtain the reply message based on the index of the reply message, and determine whether the SAS protocol message is a fault message and locate the service corresponding to the SAS protocol message based on the service number and the reply message.
5. The method according to claim 1, characterized in that The shared memory includes a protocol area, and the protocol area is used to store messages. The method further includes: According to the index of the SAS protocol message, the SAS protocol message is copied to the corresponding position of the protocol area.
6. The method according to claim 1, characterized in that The shared memory further includes a configuration area, the receiving a response message sent from the hard disk, and determining whether the response message is a response message generated for the SAS protocol message according to the SAS protocol message identifier and the response message identifier, including: Obtain the service number corresponding to the SAS protocol message; Allocating a first descriptor for the SAS protocol message in the configuration area, wherein the first descriptor includes the SAS protocol message identifier, the index of the SAS protocol message, and the service number corresponding to the SAS protocol message; Receiving a response message sent from the hard disk, and searching, according to the response message identifier, whether a SAS protocol message identifier included in the descriptor in the configuration area is consistent with the response message identifier; If so, determine that the reply message is the response message generated for the SAS protocol message, store the reply message identifier and the index of the reply message in the first descriptor, obtain the target descriptor corresponding to the SAS protocol message and the reply message, and copy the reply message to the corresponding position of the protocol area according to the index of the reply message.
7. An analysis device, characterized in that: The analysis device comprises: A transceiver module, used for receiving the index of the reply message sent from the collection device when the reply message is a response message generated for a SAS protocol message, wherein the SAS protocol message is sent by the server to the hard disk when a service needs to be executed; A processing module, configured to obtain the response message in the shared memory of the server based on the index of the response message, and determine the service number corresponding to the SAS protocol message, wherein the response message carries a status code; The processing module is further used to determine whether the SAS protocol message is a fault message according to the status code and the preset corresponding relationship; The processing module is further used to locate the service corresponding to the SAS protocol message based on the service number and the service mapping table in the shared memory if yes, wherein the service mapping table includes multiple services and the service number corresponding to each service.
8. A collecting device, characterized in that: The collecting device comprises: A transceiver module, used for acquiring a SAS protocol message sent by a server to a hard disk and an index of the SAS protocol message, wherein the SAS protocol message includes a SAS protocol message identifier; A processing module, configured to receive a response message sent from the hard disk, and determine whether the response message is a response message generated for the SAS protocol message according to the SAS protocol message identifier and the response message identifier, wherein the response message includes the response message identifier; The transceiver module is also used to send the index of the reply message to the analysis device if yes, and the analysis device is used to locate the service number corresponding to the SAS protocol message in the shared memory of the server and obtain the reply message based on the index of the reply message, and determine whether the SAS protocol message is a fault message and locate the service corresponding to the SAS protocol message based on the service number and the reply message.
9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the fault message locating method according to any one of claims 1 to 6 by executing the computer instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the fault message locating method according to any one of claims 1 to 6.
Citation Information
Patent Citations
SAS link fault positioning method and device, equipment and storage medium
CN112783703A
SAS link fault diagnosis method and device, equipment and storage medium
CN117811903A
Hard disk log obtaining method and device, hard disk log sending method and device, equipment and medium
CN117971608A
Method and device for positioning faulty disk
US20220291991A1
Server fault locating method and apparatus, electronic device, and storage medium
WO2023050671A1
