CN110958141B - Communication fault diagnosis method, device, equipment and computer readable storage medium - Google Patents
Communication fault diagnosis method, device, equipment and computer readable storage medium Download PDFInfo
- Publication number
- CN110958141B CN110958141B CN201911161224.XA CN201911161224A CN110958141B CN 110958141 B CN110958141 B CN 110958141B CN 201911161224 A CN201911161224 A CN 201911161224A CN 110958141 B CN110958141 B CN 110958141B
- Authority
- CN
- China
- Prior art keywords
- port
- optical module
- state control
- control information
- physical port
- 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.)
- Active
Links
- 238000003745 diagnosis Methods 0.000 title claims abstract description 77
- 230000006854 communication Effects 0.000 title claims abstract description 70
- 238000004891 communication Methods 0.000 title claims abstract description 68
- 238000000034 method Methods 0.000 title claims abstract description 52
- 230000003287 optical effect Effects 0.000 claims abstract description 118
- 238000003780 insertion Methods 0.000 claims abstract description 5
- 230000037431 insertion Effects 0.000 claims abstract description 5
- 238000013500 data storage Methods 0.000 claims description 36
- 230000002159 abnormal effect Effects 0.000 claims description 14
- 238000013507 mapping Methods 0.000 claims description 8
- 238000004590 computer program Methods 0.000 claims description 4
- 238000012544 monitoring process Methods 0.000 claims description 4
- 230000008569 process Effects 0.000 abstract description 8
- 238000013024 troubleshooting Methods 0.000 abstract description 3
- 230000006870 function Effects 0.000 description 7
- 230000009286 beneficial effect Effects 0.000 description 5
- 238000010586 diagram Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 2
- 238000012423 maintenance Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 230000005856 abnormality Effects 0.000 description 1
- 125000004122 cyclic group Chemical group 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/06—Management of faults, events, alarms or notifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/06—Management of faults, events, alarms or notifications
- H04L41/0677—Localisation of faults
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/06—Management of faults, events, alarms or notifications
- H04L41/069—Management of faults, events, alarms or notifications using logs of notifications; Post-processing of notifications
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Optical Communication System (AREA)
Abstract
The application discloses a communication fault diagnosis method, a communication fault diagnosis device, communication fault diagnosis equipment and a computer readable storage medium. The method is applied to 25g ports and 100g ports of a switch, and comprises the steps of circularly traversing whether optical modules of all physical ports in a network are in place or not; when detecting that a target optical module of a current physical port is in place, recording an insertion event of the target optical module in a log; reading state control information of a target optical module based on the port type of the current physical port; the port type is 25g port or 100g port; analyzing the state control information according to the position based on the port type of the current physical port to obtain a state analysis result of the target optical module; the operation state of the target optical module is diagnosed according to the state analysis result, and the diagnosis result is recorded into a log, so that whether the current fault is caused by the optical module is quickly determined by checking log information in the communication fault troubleshooting process, the communication fault diagnosis efficiency is effectively improved, and the reliable and stable operation of a network is guaranteed.
Description
Technical Field
The present application relates to the field of fault diagnosis, and in particular, to a communication fault diagnosis method, apparatus, device, and computer readable storage medium.
Background
With the rapid development of cloud technology and internet of things technology, users can acquire various required data through a computer network, and can shop, study, work, communicate and the like, the computer network becomes an indispensable part in daily work and life, and it is very necessary to ensure the stable and reliable operation of the computer network.
In large computer networks where hardware devices are indispensable, such as servers, switches, routers, etc., failure of a single hardware device or multiple hardware devices may cause the computer network to fail or even fail. The related art takes a lot of time in performing fault location or fault diagnosis, and during this time, normal and stable operation of the entire computer network may be affected.
In view of this, how to improve the communication fault diagnosis efficiency is a technical problem that needs to be solved by those skilled in the art.
Disclosure of Invention
The application provides a communication fault diagnosis method, a communication fault diagnosis device, equipment and a computer readable storage medium, which can effectively improve the communication fault diagnosis efficiency and are beneficial to ensuring the reliable and stable operation of a network.
In order to solve the above technical problems, embodiments of the present invention provide the following technical solutions:
an embodiment of the present invention provides a communication fault diagnosis method, applied to a 25g port and a 100g port of a switch, including:
circularly traversing whether the optical module of each physical port in the network is in place;
when detecting that a target optical module of a current physical port is in place, recording an insertion event of the target optical module in a log;
reading state control information of the target optical module based on the port type of the current physical port; the port type is a 25g port or a 100g port;
analyzing the state control information according to the type of the port to which the current physical port belongs in a bit mode to obtain a state analysis result of the target optical module;
and diagnosing the running state of the target optical module according to the state analysis result, and recording the diagnosis result into the log to be used as a communication fault diagnosis basis.
Optionally, the reading the state control information of the target optical module based on the port type to which the current physical port belongs includes:
determining whether the port type is a 25g port or a 100g port according to the current physical port number;
determining an eeprom equipment file path corresponding to a target optical module into which the current physical port is inserted based on a preset mapping relation between the physical port and an eeprom equipment of the optical module;
and reading the state control information of the target optical module from a target file under the file path of the eeprom device based on the data storage format corresponding to the port type of the current physical port.
Optionally, the reading, based on the data storage format corresponding to the port type to which the current physical port belongs, the state control information of the target optical module from the target file in the eeprom device file path includes:
the data storage format comprises keywords, offset and data length; the keywords are used for defining data and identifying data; the offset is used as the position information of the state control information in the target file; the data length is the number of bytes occupied by the state control information in the target file;
determining the initial storage position of the state control information in the target file based on the offset in the data storage format corresponding to the port type of the current physical port;
determining the ending storage position of the state control information in the target file based on the data length in the data storage format corresponding to the port type of the current physical port;
reading the state control information from the target file based on the starting storage location and the ending storage location.
Optionally, the analyzing the state control information bit by bit based on the port type to which the current physical port belongs to obtain the state analysis result of the target optical module includes:
reading each bit of data from the state control information based on a data storage format corresponding to the port type of the current physical port; the data storage format is uniquely corresponding to the port type;
for each bit of data, if the current bit of data is 1, returning the state control signal as a first defined value; if the current bit data is 0, returning the state control signal as a second defined value; the first definition value and the second definition value are used as mark values for judging whether the running state of the target optical module is abnormal or not;
and generating a state analysis result according to the return value corresponding to each bit of data.
Optionally, the diagnosing the operating state of the target optical module according to the state analysis result, and recording the diagnosis result in the log includes:
and when the running state of the target optical module is diagnosed to be abnormal according to the state analysis result, recording the current physical port number and the event diagnosis type into the log.
Optionally, the determining whether the optical module of each physical port in the cyclic traversal network is in place includes:
and circularly acquiring the receiving signal and the sending signal of each physical port, and determining the in-place information of the target optical module inserted into the current physical port according to the receiving signal and the sending information.
Another aspect of the embodiments of the present invention provides a communication fault diagnosis apparatus, which is applied to a 25g port and a 100g port of a switch, and includes:
the in-place information monitoring module is used for circularly traversing whether the optical module of each physical port in the network is in place;
the event recording module is used for inserting a target optical module into an event and recording the event in a log when detecting that the target optical module of the current physical port is in place;
a state control information reading module, configured to read state control information of the target optical module based on a port type to which the current physical port belongs; the port type is a 25g port or a 100g port;
the state control information analysis module is used for analyzing the state control information according to the type of the port to which the current physical port belongs in a bit mode to obtain a state analysis result of the target optical module;
and the running state diagnosis module is used for diagnosing the running state of the target optical module according to the state analysis result and recording the diagnosis result into the log to be used as a communication fault diagnosis basis.
Optionally, the state control information reading module is specifically configured to determine, according to the current physical port number, whether the port type of the port is a 25g port or a 100g port; determining an eeprom equipment file path corresponding to a target optical module into which the current physical port is inserted based on a preset mapping relation between the physical port and an eeprom equipment of the optical module; and reading the state control information of the target optical module from a target file under the file path of the eeprom device based on the data storage format corresponding to the port type of the current physical port.
An embodiment of the present invention further provides a communication fault diagnosis device, which includes a processor, and the processor is configured to implement the steps of the communication fault diagnosis method according to any one of the foregoing embodiments when executing the computer program stored in the memory.
Finally, an embodiment of the present invention provides a computer-readable storage medium, where the computer-readable storage medium stores a communication fault diagnosis program, and the communication fault diagnosis program, when executed by a processor, implements the steps of the communication fault diagnosis method according to any one of the foregoing items.
The technical scheme provided by the application has the advantages that the switch is used as the hardware equipment necessary in the data communication process, the optical module is inserted into the switch to communicate with the hardware equipment, and the operation state of the optical module influences the normal operation of communication, so that the operation state information of the optical module can be used as a basis for positioning communication faults. By analyzing the optical module state control signals of the 25g port and the 100g port in real time and recording the analyzed control signals into the log, operation and maintenance personnel and other users can quickly determine whether the current fault is caused by the optical module by checking the optical module information recorded in the log in the fault troubleshooting process, so that the efficiency of communication fault diagnosis can be effectively improved, the fault problem can be quickly positioned, the system maintainability can be improved, and the reliable and stable operation of a network can be guaranteed.
In addition, the embodiment of the invention also provides a corresponding implementation device, equipment and a computer readable storage medium for the communication fault diagnosis method, so that the method has higher practicability, and the device, the equipment and the computer readable storage medium have corresponding advantages.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions of the related art, the drawings required to be used in the description of the embodiments or the related art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic flowchart of a communication fault diagnosis method according to an embodiment of the present invention;
fig. 2 is a schematic flow chart illustrating another communication fault diagnosis method according to an embodiment of the present invention;
fig. 3 is a structural diagram of a communication fault diagnosis apparatus according to an embodiment of the present invention;
fig. 4 is a structural diagram of a specific implementation manner of the communication fault diagnosis device according to the embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the disclosure, the invention will be described in further detail with reference to the accompanying drawings and specific embodiments. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms "first," "second," "third," "fourth," and the like in the description and claims of this application and in the above-described drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "comprising" and "having," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements but may include other steps or elements not expressly listed.
Having described the technical solutions of the embodiments of the present invention, various non-limiting embodiments of the present application are described in detail below.
Referring to fig. 1, fig. 1 is a schematic flow chart of a communication fault diagnosis method according to an embodiment of the present invention, applied to a 25g port and a 100g port of a switch, where the embodiment of the present invention includes the following contents:
s101: and circularly traversing whether the optical module of each physical port in the network is in place, and if detecting that the optical module inserted into the physical port is in place, executing S102.
It will be appreciated that the physical ports of the switch communicate with devices in the computer network by inserting optical modules. Whether the optical module is in place, that is, whether the optical module is successfully plugged into the physical port and performs the corresponding communication function. Therefore, the receiving signals and the sending signals of each physical port can be obtained in a circulating way, and the in-place information of the target optical module inserted into the current physical port is determined according to the receiving signals and the sending information. Of course, other methods may be adopted, for example, an optical module timing feedback on-position signal may be set, and if the signal is not received at a preset time, it is proved that the optical module is not in position.
For convenience of description, a physical port where the optical module is located in each step below is named as a current physical port, and an optical module inserted into the port is named as a target optical module.
S102: the target light module insertion event is recorded in a log.
The log in the application can be a system log, and can also be a file which is preset and constructed and used for storing the information of the optical module, so that the implementation of the application is not influenced.
S103: and reading the state control information of the target optical module based on the port type of the current physical port.
Since the switch ports include a plurality of port types, such as 25g ports, 100g ports, 400g ports, etc., but the technical solution of the present application is only applicable to 25g ports and 100g ports, the port types referred to in the present application are 25g ports or 100g ports. The data related to the ports with different port types are stored in different positions of an eeprom (Electrically Erasable Programmable Read-Only Memory), the state control information of different port types is different, the corresponding data storage formats are also different, and after the data storage path is determined, the data can be Read from the file according to the corresponding data storage formats. For example, the status control signals for a 25g port include [ TXDisableState, SoftTXDisableSelect, RS1State, RateSelectState, SoftRateSelect, TXFaultState, rxlosstatus, dataready barstate ]; the 100g port contains 4 lanes, so the state control signals may include: [ 'Rx 1LOS', 'Rx2LOS', 'Rx3LOS', 'Rx4LOS', 'Tx1LOS', 'Tx2LOS', 'Tx3LOS', 'Tx4LOS' ].
S104: and analyzing the state control information according to the current port type of the physical port to obtain a state analysis result of the target optical module.
It can be understood that the status control signals of different port types are different, the corresponding status control data storage formats are different, and naturally, the offset and the data length according to which each bit of the status control information is read are different, so that the type to which the port belongs needs to be judged first when the status control information is analyzed according to the bit, and then, the port needs to be read according to the data storage format of the type. A data parsing function for converting each bit of data of the state control information into a preset abnormal or normal identification value and recording the parsing result may be constructed in advance so as to know the state control information directly and clearly when viewing the recording.
S105: and diagnosing the running state of the target optical module according to the state analysis result, and recording the diagnosis result into a log to be used as a communication fault diagnosis basis.
In the application, the state analysis result represents whether the state of the corresponding optical module is abnormal or not, and if the running state of the target optical module is judged to be abnormal according to the state analysis result, the current physical port number and the event diagnosis type can be recorded into a log. Optionally, a predefined function, such as a logger function, may be used to record a physical port number, an event diagnosis type, and an information description into a log when the optical module status control signal is abnormal, where the information description may be some remark information that needs to be added by a person skilled in the art according to an actual application scenario, and the event diagnosis type may be an optical module abnormality or an optical module normality.
In the technical scheme provided by the embodiment of the invention, the switch is used as an indispensable hardware device in the data communication process, the switch is used for communicating with the hardware device by inserting the optical module, and the operating state of the optical module influences the normal operation of communication, so that the operating state information of the optical module can be used as a basis for positioning communication faults. By analyzing the optical module state control signals of the 25g port and the 100g port in real time and recording the analyzed control signals into the log, operation and maintenance personnel and other users can quickly determine whether the current fault is caused by the optical module by checking the optical module information recorded in the log in the fault troubleshooting process, so that the efficiency of communication fault diagnosis can be effectively improved, the fault problem can be quickly positioned, the system maintainability can be improved, and the reliable and stable operation of a network can be guaranteed.
As an optional implementation manner, a specific implementation manner of S103 may be as follows, that is, an implementation manner of reading the state control information of the target optical module based on the port type to which the current physical port belongs may be:
determining whether the port type is a 25g port or a 100g port according to the current physical port number; determining an eeprom equipment file path corresponding to a target optical module inserted into a current physical port based on a preset mapping relation between the physical port and an eeprom equipment of the optical module; and reading the state control information of the target optical module from a target file under an eeprom equipment file path based on a data storage format corresponding to the port type of the current physical port.
It can be understood that the eprom device is used as a memory for storing physical port data, and the state control information of the optical module naturally also needs to be acquired from the eprom device, so that before reading the data information, a path for storing the information needs to be determined. The physical port and the connected eprom device can be mapped in advance, so that the corresponding eprom device can be obtained according to the physical port information such as the physical port number or the port type, and then the corresponding file is opened according to the file path of the eprom device to read the required information. The state control signals of different port types differ in the data storage format in the eprom device, including, for example, keys, offsets, and data lengths. The keywords are used for defining data and identifying data; the offset is used as the position information of the state control information in the target file; the data length is the number of bytes occupied by the state control information in the target file. The keywords are used for defining data, acquiring data corresponding to the keywords, and analyzing according to the data corresponding to the keywords. For example, a keyword manufacturer, corresponding data is a character string, and processing is performed according to the character string. For example, the corresponding data of the state control information needs to be analyzed according to bits, and the meaning of each position needs to be specified at the same time, so that the final data is analyzed. The keywords are used for identifying data, and the upper-layer application can acquire the final information stored after processing according to the keywords and then directly use the final information. For example, the offset for a 25g port may be 366, with a data length of 1 byte; the offset of 100 ports may be 3 with a data length of 1 byte. After an eprom equipment file path is determined, determining an initial storage position of state control information in a target file based on an offset in a data storage format corresponding to a port type to which a current physical port belongs; determining the ending storage position of the state control information in the target file based on the data length in the data storage format corresponding to the port type of the current physical port; state control information is read from the target file based on the starting storage location and the ending storage location.
As another embodiment, a specific implementation manner of S104 may be as follows:
reading each bit of data from the state control information based on a data storage format corresponding to the port type of the current physical port; the data storage format uniquely corresponds to the port type. For example, the data length is 1, the current bit data is determined to be in the bit number of 1 byte based on the offset address, and then the bit value is read. For each bit of data, if the current bit of data is 1, returning the state control signal as a first defined value; if the current bit data is 0, returning the state control signal as a second defined value; the first definition value and the second definition value are used as the mark values for judging whether the running state of the target optical module is abnormal or not, and are predefined. For example, data of each bit is acquired, if the data is 1, the data is returned to 'On', if the data is 0, the data is returned to 'Off', and if the state control signal is 'On', the optical module state is abnormal. And finally, generating a state analysis result according to the return value corresponding to each bit of data so as to execute corresponding operation according to the state analysis result.
In addition, the present application provides another embodiment, please refer to fig. 2, and fig. 2 is a schematic flow chart of another communication fault diagnosis method provided by the embodiment of the present invention, and the embodiment of the present invention may be applied to a computer network including switches with 25g ports and 100g ports, and specifically includes the following contents:
s201: and acquiring the current physical port number.
S202: and judging whether the target optical module inserted into the current physical port is in place, and if so, executing S203.
S203: the target light module insertion event is recorded in a log.
S204: judging whether the current physical port is a 25g port or a 100g port, if so, executing S205; if it is 25g port, S207 is executed.
S205: and determining an eeprom equipment file path corresponding to the 25g port based on the mapping relation between the physical port and the eeprom equipment of the optical module.
S206: and reading the state control information of the target optical module from the target file in the file path of the eeprom device based on the data storage format corresponding to the 25g port.
S207: and determining an eeprom equipment file path corresponding to the 100g port based on the mapping relation between the physical port and the eeprom equipment of the optical module.
S208: and reading the state control information of the target optical module from the target file in the file path of the eeprom device based on the data storage format corresponding to the 100g port.
S209: reading each bit of data from the state control information, and returning a state control signal to be on if the current bit of data is 1 for each bit of data; if the current bit data is 0, the return state control signal is off.
S210: and generating a state analysis result according to the return value corresponding to each bit of data.
S211: and when the running state of the target optical module is diagnosed to be abnormal according to the state analysis result, recording the current physical port number and the event diagnosis type into a log.
The steps or methods of the embodiments of the present invention that are the same as those of the embodiments described above may refer to the implementation processes described in the embodiments described above, and are not described herein again.
Therefore, the embodiment of the invention can effectively improve the communication fault diagnosis efficiency and is beneficial to ensuring the reliable and stable operation of the network.
The embodiment of the invention also provides a corresponding implementation device for the communication fault diagnosis method, so that the method has higher practicability. In the following, the communication fault diagnosis device provided by the embodiment of the present invention is introduced, and the communication fault diagnosis device described below and the communication fault diagnosis method described above may be referred to correspondingly.
Referring to fig. 3, fig. 3 is a structural diagram of a communication fault diagnosis apparatus according to an embodiment of the present invention, applied to a 25g port and a 100g port of a switch, where the apparatus may include:
the in-place information monitoring module 301 is configured to cycle through whether an optical module of each physical port in the network is in place.
The event recording module 302 is configured to record, in a log, an event of inserting a target optical module into the current physical port when it is detected that the target optical module is in place.
A state control information reading module 303, configured to read state control information of a target optical module based on a port type to which a current physical port belongs; the port type is 25g port or 100g port.
And the state control information analyzing module 304 is configured to analyze the state control information bitwise based on the port type to which the current physical port belongs, so as to obtain a state analysis result of the target optical module.
And an operating state diagnosing module 305, configured to diagnose an operating state of the target optical module according to the state analysis result, and record the diagnosis result in a log as a basis for communication fault diagnosis.
Optionally, in some embodiments of this embodiment, the state control information reading module 303 may be configured to determine, according to a current physical port number, whether the port type of the port is a 25g port or a 100g port; determining an eeprom equipment file path corresponding to a target optical module inserted into a current physical port based on a preset mapping relation between the physical port and an eeprom equipment of the optical module; and reading the state control information of the target optical module from a target file under an eeprom equipment file path based on a data storage format corresponding to the port type of the current physical port.
In other embodiments of the embodiment of the present invention, the state control information reading module 303 may be specifically configured to determine, based on an offset in a data storage format corresponding to a port type to which a current physical port belongs, an initial storage location of the state control information in a target file; determining the ending storage position of the state control information in the target file based on the data length in the data storage format corresponding to the port type of the current physical port; state control information is read from the target file based on the starting storage location and the ending storage location.
Optionally, in another implementation manner of this embodiment, the state control information parsing module 304 may include, for example:
the data reading submodule is used for reading each bit of data from the state control information based on a data storage format corresponding to the port type to which the current physical port belongs; the data storage format is uniquely corresponding to the port type;
the bitwise analysis submodule is used for returning the state control signal to be a first defined value for each bit of data if the current bit of data is 1; if the current bit data is 0, returning the state control signal as a second defined value; the first definition value and the second definition value are used as mark values for judging whether the running state of the target optical module is abnormal or not;
and the state analysis result generation submodule is used for generating a state analysis result according to the return value corresponding to each bit of data.
As an optional implementation manner of the present application, the operating state diagnosing module 305 may be further configured to record the current physical port number and the event diagnosis type in a log when the operating state of the target optical module is diagnosed to be abnormal according to the state analysis result.
In addition, the in-place information monitoring module 301 may be specifically configured to cyclically obtain the receiving signal and the sending signal of each physical port, and determine the in-place information of the target optical module inserted into the current physical port according to the receiving signal and the sending signal.
The functions of the functional modules of the communication fault diagnosis device according to the embodiment of the present invention may be specifically implemented according to the method in the above method embodiment, and the specific implementation process may refer to the related description of the above method embodiment, which is not described herein again.
Therefore, the embodiment of the invention can effectively improve the communication fault diagnosis efficiency and is beneficial to ensuring the reliable and stable operation of the network.
An embodiment of the present invention further provides a communication fault diagnosis device, referring to fig. 4, where the communication fault diagnosis device 4 may include:
a memory 41 for storing a computer program;
a processor 42 for executing a computer program to implement the steps of the communication fault diagnosis method according to any one of the above embodiments.
The functions of the functional modules of the communication fault diagnosis device according to the embodiment of the present invention may be specifically implemented according to the method in the above method embodiment, and the specific implementation process may refer to the related description of the above method embodiment, which is not described herein again.
Therefore, the embodiment of the invention can effectively improve the communication fault diagnosis efficiency and is beneficial to ensuring the reliable and stable operation of the network.
The embodiment of the present invention further provides a computer-readable storage medium, which stores a communication fault diagnosis program, where the communication fault diagnosis program is executed by a processor, and the steps of the communication fault diagnosis method according to any one of the embodiments above are provided. The storage medium may be various media capable of storing program codes, such as a U disk, a removable hard disk, a read-only memory, a random access memory, a magnetic disk, or an optical disk.
The functions of the functional modules of the computer-readable storage medium according to the embodiment of the present invention may be specifically implemented according to the method in the foregoing method embodiment, and the specific implementation process may refer to the related description of the foregoing method embodiment, which is not described herein again.
Therefore, the embodiment of the invention can effectively improve the communication fault diagnosis efficiency and is beneficial to ensuring the reliable and stable operation of the network.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
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 components and steps have been described above generally in terms of their functionality in order to clearly illustrate this 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 implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
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. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The communication fault diagnosis method, device, equipment and computer readable storage medium provided by the present application are described in detail above. The principles and embodiments of the present invention are explained herein using specific examples, which are presented only to assist in understanding the method and its core concepts. It should be noted that, for those skilled in the art, it is possible to make various improvements and modifications to the present invention without departing from the principle of the present invention, and those improvements and modifications also fall within the scope of the claims of the present application.
Claims (9)
1. A communication fault diagnosis method is applied to a 25g port and a 100g port of a switch, and comprises the following steps:
circularly traversing whether the optical module of each physical port in the network is in place;
when detecting that a target optical module of a current physical port is in place, recording an insertion event of the target optical module in a log;
reading state control information of the target optical module based on the port type of the current physical port; the port type is a 25g port or a 100g port;
analyzing the state control information according to the type of the port to which the current physical port belongs in a bit mode to obtain a state analysis result of the target optical module; the analyzing the state control information bit by bit based on the port type to which the current physical port belongs to obtain the state analysis result of the target optical module includes: reading each bit of data from the state control information based on a data storage format corresponding to the port type to which the current physical port belongs; the data storage format is uniquely corresponding to the port type; for each bit of data, if the current bit of data is 1, returning the state control signal as a first defined value; if the current bit data is 0, returning the state control signal as a second defined value; the first definition value and the second definition value are used as mark values for judging whether the running state of the target optical module is abnormal or not; generating a state analysis result according to the return value corresponding to each bit of data;
and diagnosing the running state of the target optical module according to the state analysis result, and recording the diagnosis result into the log to be used as a communication fault diagnosis basis.
2. The communication fault diagnosis method according to claim 1, wherein the reading the state control information of the target optical module based on the port type to which the current physical port belongs comprises:
determining whether the port type is a 25g port or a 100g port according to the current physical port number;
determining an eeprom equipment file path corresponding to a target optical module into which the current physical port is inserted based on a preset mapping relation between the physical port and an eeprom equipment of the optical module;
and reading the state control information of the target optical module from a target file under the file path of the eeprom device based on the data storage format corresponding to the port type of the current physical port.
3. The communication fault diagnosis method according to claim 2, wherein the reading of the state control information of the target optical module from the target file under the eeprom device file path based on the data storage format corresponding to the port type to which the current physical port belongs comprises:
the data storage format comprises keywords, offset and data length; the keywords are used for defining data and identifying data; the offset is used as the position information of the state control information in the target file; the data length is the number of bytes occupied by the state control information in the target file;
determining the initial storage position of the state control information in the target file based on the offset in the data storage format corresponding to the port type of the current physical port;
determining the ending storage position of the state control information in the target file based on the data length in the data storage format corresponding to the port type of the current physical port;
reading the state control information from the target file based on the starting storage location and the ending storage location.
4. The communication fault diagnosis method according to claim 1, wherein the diagnosing the operating state of the target optical module according to the state analysis result and recording the diagnosis result in the log comprises:
and when the running state of the target optical module is diagnosed to be abnormal according to the state analysis result, recording the current physical port number and the event diagnosis type into the log.
5. The communication fault diagnosis method of claim 4, wherein the determining whether the optical module of each physical port in the round-robin network is in place comprises:
and circularly acquiring a receiving signal and a sending signal of each physical port, and determining the in-place information of the target optical module inserted into the current physical port according to the receiving signal and the sending signal.
6. A communication failure diagnosis apparatus applied to a 25g port and a 100g port of a switch, comprising:
the in-place information monitoring module is used for circularly traversing whether the optical module of each physical port in the network is in place;
the event recording module is used for inserting a target optical module into an event and recording the event in a log when detecting that the target optical module of the current physical port is in place;
a state control information reading module, configured to read state control information of the target optical module based on a port type to which the current physical port belongs; the port type is a 25g port or a 100g port;
the state control information analysis module is used for analyzing the state control information according to the type of the port to which the current physical port belongs in a bit mode to obtain a state analysis result of the target optical module;
the state control information analysis module comprises:
the data reading submodule is used for reading each bit of data from the state control information based on a data storage format corresponding to the port type to which the current physical port belongs; the data storage format is uniquely corresponding to the port type;
the bitwise analysis submodule is used for returning a state control signal to be a first defined value for each bit of data if the current bit of data is 1; if the current bit data is 0, returning the state control signal as a second defined value; the first definition value and the second definition value are used as mark values for judging whether the running state of the target optical module is abnormal or not;
the state analysis result generation submodule is used for generating a state analysis result according to the return value corresponding to each bit of data;
and the running state diagnosis module is used for diagnosing the running state of the target optical module according to the state analysis result and recording the diagnosis result into the log to be used as a communication fault diagnosis basis.
7. The communication fault diagnosis device according to claim 6, wherein the state control information reading module is specifically configured to determine whether the port type is a 25g port or a 100g port according to the current physical port number; determining an eeprom equipment file path corresponding to a target optical module into which the current physical port is inserted based on a preset mapping relation between the physical port and an eeprom equipment of the optical module; and reading the state control information of the target optical module from a target file under the file path of the eeprom device based on the data storage format corresponding to the port type of the current physical port.
8. A communication failure diagnosis apparatus comprising a processor and a memory, the processor being configured to implement the steps of the communication failure diagnosis method according to any one of claims 1 to 5 when executing a computer program stored in the memory.
9. A computer-readable storage medium, wherein the computer-readable storage medium stores thereon a communication failure diagnosis program, which when executed by a processor, implements the steps of the communication failure diagnosis method according to any one of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911161224.XA CN110958141B (en) | 2019-11-24 | 2019-11-24 | Communication fault diagnosis method, device, equipment and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911161224.XA CN110958141B (en) | 2019-11-24 | 2019-11-24 | Communication fault diagnosis method, device, equipment and computer readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110958141A CN110958141A (en) | 2020-04-03 |
CN110958141B true CN110958141B (en) | 2022-08-02 |
Family
ID=69976781
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911161224.XA Active CN110958141B (en) | 2019-11-24 | 2019-11-24 | Communication fault diagnosis method, device, equipment and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110958141B (en) |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109100116B (en) * | 2018-05-24 | 2021-04-27 | 烽火通信科技股份有限公司 | Optical module fault diagnosis system and method |
-
2019
- 2019-11-24 CN CN201911161224.XA patent/CN110958141B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN110958141A (en) | 2020-04-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7966525B2 (en) | Diagnostic procedure and device for a field bus system | |
CN106330593B (en) | Protocol detection method and device | |
CN108092854B (en) | Test method and device for train-level Ethernet equipment based on IEC61375 protocol | |
CN107710683A (en) | Elasticity services | |
CN114050979B (en) | Industrial control protocol safety test system and device | |
CN111147342B (en) | MVB bus fault diagnosis method and system based on communication chip | |
CN111049571B (en) | Optical module fault prediction method and device and computer readable storage medium | |
CN110764980A (en) | Log processing method and device | |
CN110224874A (en) | A kind of processing method and processing device of equipment fault | |
CN102123058A (en) | Test equipment and method for testing network protocol decoder | |
CN110908868B (en) | Data center fault prediction method, device, equipment and readable storage medium | |
CN114363151A (en) | Fault detection method and device, electronic equipment and storage medium | |
CN105515909A (en) | Data collection test method and device | |
CN110958141B (en) | Communication fault diagnosis method, device, equipment and computer readable storage medium | |
CN109189679A (en) | Interface test method and system, electronic equipment, storage medium | |
CN111157942A (en) | Electricity stealing event monitoring method, electronic monitoring equipment and electricity stealing prevention system | |
CN115357513B (en) | Program ambiguity test method, device, equipment and storage medium | |
CN115865630B (en) | Network equipment fault diagnosis method and system based on deep learning | |
CN105843740B (en) | Method and device for detecting code compiling result | |
CN116561818A (en) | Industrial control system internal logic analysis method, system, equipment and medium | |
CN103095513A (en) | Simulation testing device and method of Encryption equipment | |
CN111124828A (en) | Data processing method, device, equipment and storage medium | |
US11665165B2 (en) | Whitelist generator, whitelist evaluator, whitelist generator/evaluator, whitelist generation method, whitelist evaluation method, and whitelist generation/evaluation method | |
CN109560964B (en) | Equipment compliance checking method and device | |
Ládi et al. | GrAMeFFSI: Graph Analysis Based Message Format and Field Semantics Inference For Binary Protocols, Using Recorded Network Traffic |
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 |