Switch communication monitoring method and electronic device
By using a monitor and processor to collaboratively monitor and process access signals on the I2C bus of the white-box switch, the problems of untimely and incomplete anomaly reporting are solved, enabling real-time and accurate communication status monitoring and anomaly handling, thus improving the stability and reliability of the system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-16
- Publication Date
- 2026-03-31
AI Technical Summary
The reporting of anomalies on the I2C bus of white-box switches is not timely or detailed enough, which affects anomaly analysis and debugging, and the reliance on external instruments makes the process complicated.
The monitor monitors the level status of access signals on the communication bus to determine the signal type and content, records level changes frame by frame, compares and analyzes anomalies with the standard communication level template, sends alarm information, and the processor records and executes anomaly handling.
It enables real-time and accurate monitoring of communication status, timely identification and recording of signal anomalies, simplifies the fault analysis process, and improves the stability and reliability of the system.
Smart Images

Figure CN121530940B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of switch technology, and in particular to a switch communication monitoring method and electronic device. Background Technology
[0002] White-box switches decouple software, reducing costs and increasing flexibility. They allow for the construction of different components and modules to meet specific vendor needs, making them popular with many vendors and data centers. The biggest advantage of white-box switches is their strong openness, offering a wider range of choices in operating systems and software. However, current white-box switches, when monitoring hardware via the I2C bus, face several challenges due to the large number of devices relying on the I2C bus and the high frequency of access. These include: insufficient low-level and detailed logging of I2C bus anomalies, hindering anomaly analysis and debugging; untimely and incomplete anomaly reporting, potentially missing minor communication anomalies and impacting reliability; and the need for external instruments to analyze the specific I2C communication process when introducing new devices or locating serious problems, resulting in a complex workflow. Summary of the Invention
[0003] This application provides a method and electronic device for monitoring communication on a switch, which at least solves the technical problems in the related art where the abnormal reporting on the I2C bus of a white-box switch is not timely or detailed enough, affecting abnormal analysis and debugging, and the reliance on external instruments to monitor the hardware working status of the white-box switch makes it difficult to perform abnormal analysis on its own, resulting in a complex process.
[0004] This application provides a method for monitoring communication in a switch. The switch includes a monitor and a processor interconnected with each other. The processor and external devices are electrically connected via a communication bus. The monitor is electrically connected to the communication bus. The method includes:
[0005] The monitor monitors the level of the access signal on the communication bus, determines the type and communication content of the access signal, and records the level changes of the access signal frame by frame.
[0006] The monitor acquires a standard communication level template and compares the recorded level changes of the access signal with the standard communication level template to analyze whether there is a communication anomaly.
[0007] In response to a communication anomaly in the access signal, the monitor sends an alarm message to determine the content of the communication anomaly.
[0008] The access signal with communication abnormality is converted into data frame access content according to a preset format, and the communication abnormality content is recorded in the data frame access content. The data frame access content is then sent to the processor.
[0009] In response to the processor receiving the data frame access content, the processor records the data frame access content in the system log and performs corresponding exception handling.
[0010] This application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for executing the computer program to implement the steps of any of the above-described switch communication monitoring methods.
[0011] The monitor monitors the level of the access signal on the communication bus, determines the type and communication content of the access signal, and records the level changes of the access signal frame by frame.
[0012] The monitor acquires a standard communication level template and compares the recorded level changes of the access signal with the standard communication level template to analyze whether there is a communication anomaly.
[0013] In response to a communication anomaly in the access signal, the monitor sends an alarm message to determine the content of the communication anomaly.
[0014] The access signal with communication abnormality is converted into data frame access content according to a preset format, and the communication abnormality content is recorded in the data frame access content. The data frame access content is then sent to the processor.
[0015] In response to the processor receiving the data frame access content, the processor records the data frame access content in the system log and performs corresponding exception handling.
[0016] This application utilizes a monitor to track changes in the access signal level between the processor and external devices, recording these changes in real time. This effectively tracks communication signal characteristics, promptly identifies and records signal anomalies. This method provides real-time and accurate communication status monitoring, aiding in the analysis of network communication health. It also provides timely alarms when communication anomalies occur, and the processor handles corresponding anomaly types, reducing the limitations of monitors in handling abnormal communication and ensuring system stability and reliability. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a diagram illustrating the application environment of a switch communication monitoring method in one embodiment of this application.
[0019] Figure 2 This is a logic diagram of a switch communication monitoring method in one embodiment of this application;
[0020] Figure 3 This is a flowchart illustrating a switch communication monitoring method in one embodiment of this application;
[0021] Figure 4 This is a structural block diagram of a switch communication monitoring device in one embodiment of this application;
[0022] Figure 5 This is an internal structural diagram of a computer device in one embodiment of this application. Detailed Implementation
[0023] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.
[0024] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.
[0025] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0026] The switch communication monitoring method provided in this application can be applied to, for example... Figure 1The application environment shown is illustrated. The switch is a white-box switch using the common SONiC system as an example. The switch includes a monitor and a processor. The monitor is a BMC system, specifically OpenBMC. The monitoring process is illustrated by accessing an external device. The processor is a CPU, the communication protocol is I2C, and the communication channel or bus is an I2C bus. The external device is the register of the CPLD. Figure 1 The system configures two external devices: a first external device and a second external device. The CPU connects to the external device via two lines of the I2C bus: SCL (clock) and SDA (data). To monitor access on the I2C bus, the BMC connects to these two lines via two GPIO interfaces, using pull-up resistors to ensure proper level reading. The SCL (clock) and SDA (data) lines transmit the clock signal (SCL) and data signal (SDA), respectively.
[0027] After the white-box switch is started, the monitoring and analysis logging program for BMC's I2C communication and the program on the NOS that receives BMC alarms both start running immediately. The monitoring and analysis logging program for BMC's I2C communication records the level changes on two GPIOs, converts these level changes into I2C frame access content that is easy for users to understand according to the I2C specification document, and logs them.
[0028] If an I2C exception occurs during access, the BMC will issue an alarm and push it to the NOS running on the CPU via RESTful or IPMI. For example, if a bus freeze occurs and the SDA bus cannot maintain a low level, after receiving the exception push from the BMC, the NOS will not only record it in the system log, but also reset the problematic I2C bus to attempt to restore I2C access.
[0029] For more in-depth debugging of CPU access to the CPLD's I2C bus, you can enable the advanced functions of the I2C communication monitoring and analysis recording program in the BMC to record the timing of GPIO received level changes and determine if there are any abnormalities in the access timing. For specific procedures, please refer to [link / reference needed]. Figure 2 .
[0030] In general, the BMC device of the white-box switch is used to assist the CPU-side operating system in recording all accesses on the I2C bus and issuing anomaly alarms at the I2C frame level, which facilitates subsequent analysis and troubleshooting. The specific solution is as follows:
[0031] On the hardware side, the BMC needs to connect to the I2C bus of all CPU-connected peripheral devices through its own GPIO, including the SCL (clock signal) and SDA (data signal) signals; in order to obtain the level status on the I2C bus and record the access in the form of I2C frames; here, the BMC's GPIO needs to be configured as an input state, and pull-up or pull-down resistors also need to be configured according to the actual situation to ensure that the BMC can receive the correct signal changes on the I2C bus;
[0032] On the software side, the main requirement is to run an I2C communication monitoring and analysis logging program on the BMC of the white-box switch. This program needs to continuously run and record all I2C bus accesses of the white-box switch NOS to prevent omissions. The structure of this monitoring program is as follows:
[0033] 1) I2C bus level change recording program: This part continuously records the communication process on the I2C bus obtained through the high and low level changes of BMC GPIO, and records it for use in the next step of analysis;
[0034] 2) I2C bus signal analysis program: This part of the program determines the type of frame accessed and the specific content of the I2C bus based on the recorded changes in the I2C bus level and the internal template of the I2C specification access frame format. For example, start -> read device XX register at address XX -> device at address XX returns data XX -> end.
[0035] 3) I2C bus signal recording and alarm program: This part of the program obtains the I2C access frame content from the analysis program, records the communication content in the log, and records it as a complete access. At the same time, if there is an abnormality, such as a communication failure, the device returning an abnormal signal, or the bus hanging, the abnormality needs to be recorded and reported immediately.
[0036] By using the above methods, when the CPU detects an I2C access anomaly, it can analyze the anomaly at the I2C frame level by checking the log records of the I2C access monitoring software on the BMC, providing development and maintenance personnel with more detailed analysis. This improves system maintainability.
[0037] In addition to the basic functions of the BMC I2C communication monitoring software mentioned above, the software can also provide simple analysis of I2C bus signals. For example, it can analyze whether the duration of the recorded level signal conforms to the I2C specification and whether the voltage level meets the requirements. Therefore, it can perform simple analysis and location of I2C signals without relying on external instruments, replacing oscilloscopes, logic analyzers, etc., and simplifying the fault analysis process for new or abnormal devices. Since recording and analyzing this type of data requires more BMC hardware resources than the basic functions, users can choose whether to enable this advanced function, making it more flexible.
[0038] On the CPU side of the white-box switch, I2C bus access anomaly alarms can be obtained through communication with the BMC, and corresponding anomaly handling can be performed, including resetting the bus when the I2C device is unresponsive or the bus is stuck; retrying I2C access when a device access fails, etc. At the same time, a monitoring process also runs on the CPU's NOS to receive I2C access anomalies detected by the BMC.
[0039] The I2C bus access log format recorded by the BMC is: <Communication Time>-<Communication Successful?>-<External Device Address Accessed-Register Address-Read / Write>-<Data Read or Written>-<Exception Type If Any Exception Exists>. This format allows for easy determination of whether the I2C access process was completed and the acquisition of specific access information.
[0040] This application facilitates the recording and analysis of I2C bus access processes by white-box switches, improving the detail of log recording and making it easier to locate the root cause of anomalies. It also provides more detailed alarms for anomalies detected on the I2C bus, enabling the NOS (Normally Insulated Switch) to identify the anomaly type and take appropriate action, thus improving the reliability of the white-box switch. Furthermore, this application facilitates timing analysis and anomaly debugging of I2C devices without relying on other analytical instruments. The logs recorded by this application are clear and concise, making it easier for users to analyze and locate anomalies.
[0041] like Figure 3 As shown, an embodiment of this application provides a method for monitoring communication in a switch. The switch includes a monitor and a processor connected to each other. The processor and external devices are electrically connected via a communication bus. The monitor is electrically connected to the communication bus. The method includes the following steps:
[0042] Step S1: Monitor the level of the access signal on the communication bus using a monitor to determine the type of access signal and the communication content, and record the level changes of the access signal frame by frame.
[0043] Step S2: Obtain the standard communication level template, and compare the recorded access signal level changes with the standard communication level template to analyze whether there is a communication anomaly.
[0044] Step S3: In response to the communication anomaly in the access signal, the monitor sends an alarm message to determine the content of the communication anomaly.
[0045] Step S4: Convert the access signal with communication error into data frame access content according to the preset format, record the communication error content in the data frame access content, and send the data frame access content to the processor.
[0046] Step S5: In response to the processor receiving the data frame access content, the processor records the data frame access content in the system log and performs the corresponding exception handling.
[0047] This method involves monitoring the level changes of access signals between the processor and external devices using a monitor, and recording these changes in real time. This effectively tracks the signal characteristics of communication, promptly identifies and records signal anomalies. It provides real-time and accurate communication status monitoring, aids in analyzing the health of network communication, and promptly alerts when communication anomalies occur. The processor handles the corresponding anomaly types, reducing the limitations of monitors in handling abnormal communication and ensuring the stability and reliability of the system.
[0048] The monitor is preferably a baseboard management controller, and the processor is preferably a central processing unit.
[0049] The system includes multiple external devices. When the monitor detects the level of the access signal, it also samples the access signals of multiple external devices in parallel and distinguishes the sampling data of different communication channels by using signal identifiers. The sampling results are cached in the corresponding channel data area so that the access behavior of different communication channels can be recorded independently in the system log.
[0050] When the monitor performs parallel sampling, it uses a synchronous clock module to align the sampling time of each channel and adds a unified timestamp to each level change data in the system log, thereby ensuring the comparability and traceability of multi-channel signals in the time dimension.
[0051] The synchronization clock module includes a hardware timer and a software time calibration program. The hardware timer provides a high-precision time reference signal, while the software time calibration program periodically corrects the system clock deviation between the monitor and the processor to ensure the consistency of log time recording.
[0052] When generating alarm information, the monitor stores the alarm information in a preset alarm queue according to the alarm priority. The priority is automatically evaluated based on the type of abnormality, the frequency of occurrence and the scope of impact. Alarm information with higher priority is pushed to the processor for abnormality handling first.
[0053] The monitor periodically counts the number of occurrences, average intervals, and processing status of various anomalies, and generates a communication health index based on the statistical results. The health index is used to reflect the long-term operational stability of the communication bus and devices.
[0054] The communication health index is divided into four levels: normal, slightly abnormal, moderately abnormal, and severely abnormal. When the health index of the target external device is lower than the preset threshold, the monitor sends an early warning signal to the processor to prompt maintenance of the target external device.
[0055] In this embodiment, the level status of access signals on the communication bus is monitored by a monitor to determine the type and content of the access signals, and the level changes of the access signals are recorded frame by frame, including:
[0056] The monitor monitors the level of the clock signal (SCL) and data signal (SDA) in the access signals on the communication bus between the processor and the external device, and identifies whether there are any changes in the level of the clock signal (SCL) and data signal (SDA) in the access signals.
[0057] In response to changes in the levels of the clock signal (SCL) and data signal (SDA) in the access signal, the duration and amplitude of the clock signal (SCL) and data signal (SDA) in the access signal are determined, and it is judged whether the duration and amplitude of the levels conform to the communication timing specifications.
[0058] When a timing error alarm is generated in response to the detection that the duration or amplitude of the level does not conform to the preset specification;
[0059] When the level duration or level amplitude is detected to meet the preset specification, the level change data is recorded;
[0060] Based on the recorded level changes of the access signal, the type and communication content of the access signal are determined, and the level changes of the access signal are recorded in the system log frame by frame.
[0061] This improvement enhances the accuracy of signal analysis, particularly in monitoring level changes in clock and data signals. By analyzing signal timing, it can further detect timing anomalies during communication, such as deviations in signal duration or amplitude from preset specifications, thus providing more detailed anomaly monitoring. This precise timing monitoring can provide early warnings of potential communication failures, preventing wider system failures caused by timing issues.
[0062] In this embodiment, a standard communication level template is obtained, and the recorded access signal level changes are compared with the standard communication level template to analyze whether there is a communication anomaly, including:
[0063] The standard communication level template for the access frame format of the communication protocol specification for acquiring access signals;
[0064] The recorded level changes of the access signal are compared frame by frame with the standard communication level template. The level change data is analyzed based on the standard communication level template to determine the type of access signal and the communication content.
[0065] Record the communication content in the system log in segments according to each access;
[0066] When an alarm is triggered indicating a timing anomaly in the communication content, a communication anomaly is determined to exist.
[0067] By analyzing the level changes of access signals and combining this with the access frame format template specified in the communication protocol, the signal type and communication content can be accurately determined and recorded in the system log according to the frame structure. This precise data recording and analysis helps in subsequent communication fault diagnosis and communication content tracing, clearly displaying the details of each communication and effectively supporting communication fault investigation and performance analysis.
[0068] In this embodiment, in response to a communication anomaly in the access signal, the content of the communication anomaly is determined, including:
[0069] The monitor determines whether the communication of the access signal can be completed completely based on the changes in the level of the access signal;
[0070] If the communication in response to the access signal can be completed completely, the access is considered normal.
[0071] If communication in response to an access signal cannot be completed, an access error is determined, the error signal is identified, and it is determined whether the bus is stuck.
[0072] In response to a bus hang, the abnormal signal and bus hang information are recorded.
[0073] The master device that initiates communication and the slave device that receives communication are determined based on the communication bus corresponding to the abnormal signal. The device that has an abnormality is identified as the abnormal device based on the address field in the communication start frame of the abnormal signal.
[0074] Based on the frame-by-frame comparison of the abnormal signal level changes with the standard communication level template, the abnormal communication step, abnormal location, abnormal cause, and abnormal type are determined and recorded as communication abnormal content.
[0075] By using a monitor to determine whether the access signal can complete the communication process, abnormalities can be effectively identified. If communication fails to complete normally, the abnormal signal can be identified in a timely manner, and it can be determined whether a bus hang has occurred. In this way, communication anomalies can be quickly identified and responded to, preventing the anomalies from continuously affecting system operation and improving the stability and robustness of the communication system.
[0076] In this embodiment, when the monitor determines whether the communication of the access signal can be completely completed based on the level change of the access signal, it further includes:
[0077] The monitor identifies the clock signal (SCL) and data signal (SDA) in the access signal, and samples the rising edge, falling edge and steady-state range of the clock signal (SCL) and data signal using a time base;
[0078] By calculating the edge rise time, fall time, and duty cycle parameters, it can be determined whether there is jitter, glitches, or delay deviation in the communication of the access signal.
[0079] If edge delay deviation or jitter or glitch width is detected that exceeds the preset threshold, it is marked as an integrity abnormality in the communication of the access signal.
[0080] The access signal with integrity anomalies is associated with the corresponding external device, and the abnormal waveform parameter values are recorded in the system log. The abnormal waveform parameter values include edge time, glitch width, level hold time and sampling frequency.
[0081] By performing detailed sampling and analysis of the clock and data signals of the access signal, it is possible to accurately determine whether there are problems such as jitter, glitches, or delay deviations in the signal. This precise signal integrity detection method helps to promptly detect communication faults caused by signal quality issues and records abnormal waveform parameters, providing strong technical support for subsequent troubleshooting.
[0082] In this embodiment, based on the frame-by-frame comparison of the abnormal signal level change with the standard communication level template, the abnormal communication step, abnormal location, abnormal cause, and abnormal type are determined, including:
[0083] When the abnormal device is a processor, compare the abnormal signal timing with the normal timing. The comparison includes the rise and fall time of the level, the holding time of the high level and the low level, and the communication time interval. When a timing abnormality occurs, record the location of the abnormality, the cause of the abnormality, and the type of the abnormality.
[0084] When the abnormal device is an external device, compare the level characteristics of the abnormal signal with the standard level characteristics of the external device. The comparison includes level amplitude, level duration, and level change frequency. When an abnormal level characteristic occurs, record the location of the abnormality, the cause of the abnormality, and the type of abnormality.
[0085] In this embodiment, converting access signals with communication anomalies into data frame access content according to a preset format includes:
[0086] Obtain the communication time of the access signal, the address of the accessed external device, and the register address;
[0087] Identify whether the access signal is for reading or writing, and identify the data read or written by the access signal;
[0088] Determine whether the access signal indicates successful communication;
[0089] If the access signal is found to be abnormal during the communication process, the type of abnormality is obtained.
[0090] The access signal is converted into data frame access content according to the preset format of <communication time>-<communication success status>-<address of external device accessed-register address-read / write>-<data read or written>-<exception type if there is an exception>.
[0091] By converting information such as communication time, address, and read / write operations from access signals into standardized data frame content, the specific operations during the communication process can be tracked and recorded more accurately. This recording method helps in subsequent analysis of whether each access was successful and can identify anomalies. If problems occur during communication, it can provide detailed anomaly information, supporting rapid location of the problem source and implementation of corresponding remedial measures.
[0092] Specifically, the format of the I2C bus frame access log recorded by the BMC is as follows:
[0093] <Time> - <Communication success status> - <Accessed device I2C address - Register address - Read / Write> - <Data read or written>;
[0094] If a data frame error occurs, the log will have the following format:
[0095] <Time>-<Abnormality Type>-<Abnormal Master Device I2C Link Number>-<Abnormal Slave Device Address>;
[0096] If a timing anomaly occurs, the log will have the following format:
[0097] <Time>-<Abnormal Timing Type>-<Abnormal Timing Reason>-<Abnormal Master Device I2C Link Number>-<Abnormal Slave Device Address>-<Expected Timing Value>;
[0098] By comparing the above format with the frame template of normal I2C communication, it is easy to determine whether the I2C access process is complete and obtain specific access information.
[0099] In this embodiment, the processor records the data frame access content to the system log and performs corresponding exception handling, including:
[0100] The processor identifies the type of anomaly in the data frame access content, including master device anomaly, slave device anomaly, and bus hang.
[0101] The processor acquires the abnormal frequency. When the abnormal frequency exceeds a preset abnormal frequency threshold or the same abnormal type occurs consecutively a preset number of times, the abnormality is processed.
[0102] When the exception type is a master device exception, the processor is restarted and it is determined whether the restarted processor has recovered. If it has not recovered and a master device exception still exists, the configuration registers of the corresponding timing of the processor are adjusted until the timing of the exception is normal.
[0103] When the exception type is a slave device exception, restart the malfunctioning external device, determine whether the restarted external device has recovered, and if it has not recovered, issue a maintenance log message.
[0104] When the exception type is bus hang, the communication bus is reset, the control processor sends the corresponding signals according to the specification, and it is determined whether external device access is restored. If it is not restored, maintenance log information is issued.
[0105] In the event of a communication anomaly, the processor can react promptly based on the anomaly type, recording the anomaly information in the system log and performing appropriate anomaly handling. This not only ensures the system's real-time response but also effectively prevents fault propagation, ensuring the normal operation of the communication system. This measure enhances the system's fault tolerance and self-recovery capabilities, contributing to improved overall system stability.
[0106] The system sends communication detection signals to external devices via the processor to determine if the devices are responding, effectively identifying communication bus jams or device malfunctions. If an external device is found to be unresponsive, the system can automatically reset the communication bus, restore access, and prevent communication interruptions caused by device failure. This feature enhances the system's self-healing capabilities, ensuring uninterrupted communication between devices.
[0107] In this embodiment, before monitoring the level of the access signal on the communication bus through a monitor, determining the type and content of the access signal, and recording the level changes of the access signal frame by frame, the method further includes:
[0108] Get the external devices connected to the processor;
[0109] Check if the communication bus between the processor and external devices is stuck;
[0110] If the communication bus between the processor and the external device is stuck, the exception type is recorded and pushed to the processor for exception handling. The communication bus between the processor and the external device is checked again to see if it is stuck.
[0111] If the communication bus between the processor and the external device is not stuck, the level of the access signal between the processor and the external device is monitored by the monitor.
[0112] By checking whether the communication bus is stuck, the health of the communication bus can be assessed in advance before monitoring access signals, allowing potential communication problems to be detected early. If the communication bus is stuck, the abnormal information can be recorded and reported in a timely manner, preventing disruption to continued signal monitoring. This pre-detection function can effectively reduce the probability of system failures and improve the efficiency and accuracy of overall monitoring.
[0113] In the aforementioned switch communication monitoring method, the monitor tracks the level changes of access signals between the processor and external devices, recording these changes in real time. This effectively tracks communication signal characteristics, promptly identifies and records signal anomalies. This method provides real-time and accurate communication status monitoring, aiding in the analysis of network communication health. It also provides timely alarms when communication anomalies occur, and the processor handles corresponding anomaly types, reducing the monitor's inability to process anomalies and ensuring system stability and reliability.
[0114] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.
[0115] In one embodiment, such as Figure 4 As shown, a switch communication monitoring device 10 is provided, including: a signal monitoring and sampling module 1, a communication parsing and comparison module 2, an anomaly detection and judgment module 3, an alarm encapsulation and push module 4, and an anomaly handling and recovery module 5.
[0116] The signal monitoring and sampling module 1 is used to monitor the level status of access signals on the communication bus through a monitor, determine the type and communication content of the access signals, and record the level changes of the access signals frame by frame.
[0117] The communication parsing and comparison module 2 is used to obtain a standard communication level template and compare the recorded access signal level changes with the standard communication level template to analyze whether there is a communication anomaly.
[0118] The anomaly detection and judgment module 3 is used to respond to the presence of communication anomalies in the access signal, and the monitor sends alarm information to determine the content of the communication anomaly.
[0119] The alarm encapsulation and push module 4 is used to convert access signals with communication abnormalities into data frame access content according to a preset format, record the communication abnormality content in the data frame access content, and send the data frame access content to the processor.
[0120] The exception handling and recovery module 5 is used to respond to the processor receiving data frame access content. The processor records the data frame access content in the system log and performs the corresponding exception handling.
[0121] In the aforementioned switch communication monitoring device, the monitor tracks the level changes of access signals between the processor and external devices, recording these changes in real time. This effectively tracks communication signal characteristics, promptly identifies and records signal anomalies. This method provides real-time and accurate communication status monitoring, aiding in the analysis of network communication health. It also provides timely alarms when communication anomalies occur, and the processor handles the corresponding anomaly types, reducing the monitor's inability to process anomalies and ensuring system stability and reliability.
[0122] For a description of the features in the embodiment corresponding to the switch communication monitoring device, please refer to the relevant description in the embodiment corresponding to the switch communication monitoring method, which will not be repeated here.
[0123] Embodiments of this application also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the steps in any of the above embodiments of the switch communication monitoring method.
[0124] In one embodiment, the electronic device may be a server, and its internal structure diagram may be as follows: Figure 5 As shown, the electronic device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database stores switch communication monitoring data. The network interface communicates with external terminals via a network connection. When the computer program is executed by the processor, it implements a switch communication monitoring method.
[0125] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above embodiments of the switch communication monitoring method when running:
[0126] The level status of access signals on the communication bus is monitored by a monitor to determine the type of access signal and the communication content, and the level changes of access signals are recorded frame by frame.
[0127] Obtain a standard communication level template, and compare the recorded access signal level changes with the standard communication level template to analyze whether there are any communication anomalies;
[0128] In response to a communication anomaly detected in the access signal, the monitor sends an alarm message to determine the nature of the communication anomaly.
[0129] The access signal with communication error is converted into data frame access content according to the preset format, the communication error content is recorded in the data frame access content, and the data frame access content is sent to the processor.
[0130] In response to the processor receiving data frame access content, the processor records the data frame access content in the system log and performs the corresponding exception handling.
[0131] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0132] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above embodiments of the switch communication monitoring method:
[0133] The level status of access signals on the communication bus is monitored by a monitor to determine the type of access signal and the communication content, and the level changes of access signals are recorded frame by frame.
[0134] Obtain a standard communication level template, and compare the recorded access signal level changes with the standard communication level template to analyze whether there are any communication anomalies;
[0135] In response to a communication anomaly detected in the access signal, the monitor sends an alarm message to determine the nature of the communication anomaly.
[0136] The access signal with communication error is converted into data frame access content according to the preset format, the communication error content is recorded in the data frame access content, and the data frame access content is sent to the processor.
[0137] In response to the processor receiving data frame access content, the processor records the data frame access content in the system log and performs the corresponding exception handling.
[0138] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above embodiments of the switch communication monitoring method:
[0139] The level status of access signals on the communication bus is monitored by a monitor to determine the type of access signal and the communication content, and the level changes of access signals are recorded frame by frame.
[0140] Obtain a standard communication level template, and compare the recorded access signal level changes with the standard communication level template to analyze whether there are any communication anomalies;
[0141] In response to a communication anomaly detected in the access signal, the monitor sends an alarm message to determine the nature of the communication anomaly.
[0142] The access signal with communication error is converted into data frame access content according to the preset format, the communication error content is recorded in the data frame access content, and the data frame access content is sent to the processor.
[0143] In response to the processor receiving data frame access content, the processor records the data frame access content in the system log and performs the corresponding exception handling.
[0144] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0145] The present application provides a detailed description of a switch communication monitoring method and electronic device. Specific examples have been used to illustrate the principles and implementation methods of the present application. The descriptions of these embodiments are only intended to aid in understanding the method and its core ideas. It should be noted that those skilled in the art can make various improvements and modifications to the present application without departing from its principles, and these improvements and modifications also fall within the protection scope of the present application.
Claims
1. A method for monitoring communications of a switch, the method comprising: The switch comprises a monitor and a processor connected with each other, the processor and the external device are electrically connected through a communication bus, the monitor is electrically connected with the communication bus, and the method comprises: The monitor monitors the level state of the access signal on the communication bus, determines the type and communication content of the access signal, and records the level change of the access signal by frame; A standard communication level template is obtained, and the recorded level change of the access signal is compared and analyzed with the standard communication level template to determine whether there is communication abnormality; In response to the existence of communication abnormality of the access signal, the monitor sends alarm information to determine the communication abnormality content; The access signal with communication abnormality is converted into data frame access content according to a preset format, the communication abnormality content is recorded in the data frame access content, and the data frame access content is sent to the processor; In response to the processor receiving the data frame access content, the processor records the data frame access content into a system log and executes corresponding abnormality processing; The standard communication level template is obtained, and the recorded level change of the access signal is compared and analyzed with the standard communication level template to determine whether there is communication abnormality; The standard communication level template of the communication protocol specification access frame format of the access signal is obtained; The recorded level change of the access signal is compared with the standard communication level template frame by frame, and the type and communication content of the access signal are determined according to the analysis of the level change data of the standard communication level template; The communication content is recorded in the system log by segmenting each access content; In response to the existence of timing abnormality alarm of the communication content, it is determined that there is communication abnormality.
2. The switch communication monitoring method according to claim 1, wherein The monitor monitors the level state of the access signal on the communication bus, determines the type and communication content of the access signal, and records the level change of the access signal by frame; The monitor monitors the level state of the access signal on the communication bus, determines the type and communication content of the access signal, and records the level change of the access signal by frame; In response to the existence of timing abnormality alarm of the communication content, it is determined that there is communication abnormality. The monitor monitors the level state of the access signal on the communication bus, determines the type and communication content of the access signal, and records the level change of the access signal by frame; 3. The switch communication monitoring method of claim 1, wherein, If the communication of the access signal can be completed completely, it is determined that the access is normal; If the communication of the access signal cannot be completed completely, it is determined that the access is abnormal, an abnormal signal is identified, and whether the bus is dead is determined; If the bus is dead, the abnormal signal and the bus dead information are recorded; According to the communication bus corresponding to the abnormal signal, the master device initiating communication and the slave device receiving communication are determined, and according to the address field in the communication start frame of the abnormal signal, the device appearing abnormal is determined as an abnormal device; According to the frame-by-frame comparison result of the level change of the abnormal signal and the standard communication level template, the communication step, the abnormal position, the abnormal reason and the abnormal type appearing abnormal are determined, and are recorded as communication abnormal content.
4. The switch communication monitoring method according to claim 3, wherein When the monitor determines whether the communication of the access signal can be completed completely according to the level change of the access signal, the monitor further comprises: The monitor identifies the clock signal and the data signal in the access signal, and samples the rising edge, the falling edge and the steady state interval of the clock signal and the data signal by using a time reference; By calculating the edge rising time, the edge falling time and the duty cycle parameter, whether the communication of the access signal exists jitter, glitch or delay deviation is determined; If the edge delay deviation or the jitter, the glitch width exceeds the preset threshold, it is marked that the communication of the access signal exists integrity abnormality; The access signal existing integrity abnormality is associated to the corresponding external device, and the abnormal waveform parameter value is recorded in the system log, the abnormal waveform parameter value includes the edge time, the glitch width, the level holding time and the sampling frequency.
5. The method of claim 3, wherein the method further comprises: According to the frame-by-frame comparison result of the level change of the abnormal signal and the standard communication level template, the communication step, the abnormal position, the abnormal reason and the abnormal type appearing abnormal are determined, and are recorded as communication abnormal content. When the abnormal device is a processor, the abnormal signal timing is compared with the normal timing, and the comparison content includes the level rising and falling time, the high level and low level holding time, and the communication time interval. When the time is abnormal, the position, the reason and the type of the abnormality are recorded. When the abnormal device is an external device, the level characteristics of the abnormal signal are compared with the standard level characteristics of the external device, and the comparison content includes the level amplitude, the level duration and the level change frequency. When the level characteristics are abnormal, the position, the reason and the type of the abnormality are recorded.
6. The switch communication monitoring method of claim 1, wherein, According to the preset format, the access signal existing communication abnormality is converted into data frame access content, which comprises: The communication time of the access signal, the external device address accessed, and the register address are obtained; The access signal is identified as reading or writing, and the data of the reading or writing of the access signal is identified; Whether the communication of the access signal is successful is determined; The duration of the access signal in the communication process is detected for abnormality. If there is abnormality, the abnormal type is obtained; The access signal is converted into data frame access content according to the preset format of <communication time>-<communication success>-<accessed external device address-register address-reading / writing>-<read or write data>-<if there is abnormality, abnormal type>.
7. The method of claim 1, wherein the method further comprises: The processor records the data frame access content into a system log and performs corresponding exception processing, including: The processor identifies an exception type of the data frame access content, wherein the exception type includes a master device exception, a slave device exception, and a bus hang-up; The processor acquires an exception frequency, and when the exception frequency is greater than a preset exception frequency threshold or a same exception type appears continuously for a preset number of times, the exception is processed; When the processed exception type is the master device exception, the processor restarts the processor, judges whether the restarted processor is recovered, and if not, adjusts a configuration register of a corresponding timing of the processor until the timing of the exception is normal; When the processed exception type is the slave device exception, the processor restarts an external device of the exception, judges whether the restarted external device is recovered, and if not, issues a maintenance log information; When the processed exception type is the bus hang-up, the processor resets a communication bus, controls the processor to send a corresponding signal according to a specification, judges whether the external device access is recovered, and if not, issues the maintenance log information.
8. The method of claim 1, wherein: Before the step of monitoring, by the monitor, a level state of an access signal on the communication bus, determining a type and communication content of the access signal, and recording, in a frame, a level change of the access signal, the method further includes: acquiring an external device connected to the processor; checking whether a communication bus between the processor and the external device is deadlocked; in response to the communication bus between the processor and the external device being deadlocked, recording an exception type and pushing the exception type to the processor for exception processing, and checking again whether the communication bus between the processor and the external device is deadlocked; in response to the communication bus between the processor and the external device not being deadlocked, monitoring, by the monitor, a level state of an access signal between the processor and the external device.
9. An electronic device, comprising: The method includes: a memory for storing a computer program; a processor for executing the computer program to implement the steps of the switch communication monitoring method according to any one of claims 1 to 8.
Citation Information
Patent Citations
I2C channel monitoring method, I2C channel monitoring system and related device
CN111176952A
Abnormity detection method and device for communication bus
CN120762956A