Methods, devices, equipment and storage media for detecting anomalies in communication links
By continuously acquiring data frames in fiber optic serial communication and using the idle duration and the number of abnormal intervals between adjacent data frames for comprehensive detection, the problem of the inability to comprehensively monitor communication link anomalies in existing technologies is solved, realizing multi-dimensional monitoring of the communication link and improving the stability and reliability of communication.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CYG SUNRI CO LTD
- Filing Date
- 2026-07-06
- Publication Date
- 2026-07-31
AI Technical Summary
Existing technologies cannot comprehensively monitor various types of communication link anomalies in fiber optic serial communication, especially frame interval offset and communication link degradation, which affects the real-time performance and stability of communication.
By continuously acquiring data frames from the communication link, and using the idle duration and the number of abnormal arrival intervals between adjacent data frames, the system detects whether the communication link is interrupted or degraded, and combines the results of both for comprehensive detection, thus achieving multi-dimensional monitoring of the communication link.
It enables comprehensive monitoring of fiber optic serial communication links, timely identification of communication link interruptions and degradation, improves the comprehensiveness and reliability of communication link monitoring, and ensures the stability and reliability of communication.
Smart Images

Figure CN122496439A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of communication link monitoring and fault diagnosis technology, and in particular relates to a method, device, equipment and storage medium for detecting anomalies in communication links. Background Technology
[0002] With the rapid development of industrial control, power automation and other fields, fiber optic serial (optical string) communication has become the mainstream communication method in high-reliability scenarios due to its advantages such as strong resistance to electromagnetic interference, long transmission distance and excellent electrical isolation. Fiber optic communication typically transmits control frames at a fixed baud rate and fixed period, which places extremely high demands on the real-time performance and stability of the communication link.
[0003] To ensure communication quality, traditional communication link detection schemes generally use single-frame verification to detect frame content errors. This scheme can only solve the single anomaly of frame content corruption.
[0004] In practical engineering, communication link anomalies manifest in various forms, not just limited to errors in a single frame. Therefore, existing single-frame verification schemes, which can only handle specific types of anomalies, are insufficient to meet the needs of comprehensive monitoring of communication links in high-reliability scenarios. Summary of the Invention
[0005] This application provides a method, apparatus, device, and storage medium for detecting anomalies in communication links, which can simultaneously detect multiple types of communication link anomalies, thereby improving the comprehensiveness and reliability of communication link monitoring.
[0006] In a first aspect, embodiments of this application provide a method for detecting anomalies in a communication link, including: Continuously acquire data frames from the communication link; The first detection result, characterizing whether the communication link is interrupted, is determined based on the idle duration after the most recent received data frame. The second detection result, which characterizes whether the communication link has degraded, is determined based on the number of abnormal arrival time intervals between adjacent data frames within a preset time window. Based on the first and second test results, the comprehensive test result of the communication link is determined.
[0007] In one possible implementation of the first aspect, determining a first detection result characterizing whether the communication link is interrupted based on the idle duration after the most recently received data frame includes: determining the idle duration based on the current time and the arrival time of the most recently received data frame; comparing the idle duration with a preset time threshold to obtain a comparison result; and determining the first detection result characterizing whether the communication link is interrupted based on the comparison result.
[0008] In one possible implementation of the first aspect, determining a second detection result characterizing whether the communication link is degraded based on the number of times the arrival time interval between adjacent data frames is abnormal within a preset time window includes: for each adjacent data frame, determining the arrival time interval between adjacent data frames based on the arrival time of the adjacent data frames; determining a detection result characterizing whether the frame interval is abnormal based on the arrival time interval and a preset time interval; counting the number of times all detection results characterize the frame interval abnormality within the preset time window; and determining a second detection result characterizing whether the communication link is degraded based on the number of times and a preset number threshold.
[0009] In one possible implementation of the first aspect, when the comprehensive detection result indicates an abnormality in the communication link, the method further includes: counting the number of target data frames received consecutively within a subsequent preset time window; the target data frame refers to a data frame whose idle duration at the current moment is not greater than a preset time threshold and whose frame interval is normal; when the number is not less than a preset number threshold, it is determined that the communication link has returned to normal.
[0010] In one possible implementation of the first aspect, determining the comprehensive detection result of the communication link based on the first detection result and the second detection result includes: determining that the comprehensive detection result of the communication link indicates an abnormal communication link when the first detection result indicates that the communication link is interrupted, or when the second detection result indicates that the communication link is degraded; and determining that the comprehensive detection result of the communication link indicates that the communication link is normal when the first detection result indicates that the communication link is not interrupted and when the second detection result indicates that the communication link is not degraded.
[0011] In one possible implementation of the first aspect, continuously acquiring data frames from the communication link includes: filtering the original signal continuously output by the communication link to obtain a filtered signal; decoding the filtered signal to obtain a decoded data stream; identifying frame boundaries in the decoded data stream to obtain identified data frames; performing integrity verification on the identified data frames, determining that the identified data frames that pass the integrity verification are the final data frames, and determining the arrival time of the data frames.
[0012] In one possible implementation of the first aspect, after determining the comprehensive detection result of the communication link, the method further includes: in the output clock domain, performing multi-sampling continuous sampling on the comprehensive detection result representing the communication link anomaly from the sampling clock domain to obtain multi-sampling values; and outputting sampling values in response to the consistency of the multi-sampling values.
[0013] Secondly, embodiments of this application provide an anomaly detection device for a communication link, comprising: The receiving module is used to continuously acquire data frames from the communication link; The first detection module is used to determine a first detection result characterizing whether the communication link is interrupted based on the idle duration after the most recent received data frame. The second detection module is used to determine the second detection result, which characterizes whether the communication link has degraded, based on the number of abnormal arrival time intervals of adjacent data frames within a preset time window. The integrated detection module is used to determine the integrated detection result of the communication link based on the first detection result and the second detection result.
[0014] Thirdly, embodiments of this application provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the communication link anomaly detection method described above.
[0015] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the communication link anomaly detection method described above.
[0016] Fifthly, embodiments of this application provide a computer program product that, when run on a terminal device, causes the terminal device to execute the communication link anomaly detection method described in any of the first aspects above.
[0017] The beneficial effects of the embodiments in this application compared with the prior art are: This application provides a method, apparatus, device, and storage medium for detecting anomalies in communication links. By continuously acquiring data frames from the communication link, a continuous and real-time data foundation is provided for subsequent multi-dimensional detection, avoiding detection blind spots caused by intermittent sampling. Based on this, on the one hand, for extreme disconnection scenarios where the communication link is completely frameless, a first detection result characterizing whether the communication link is interrupted is determined based on the idle duration since the most recent received data frame. This monitors whether any data frames arrive, thereby determining whether the communication link is interrupted, overcoming the deficiency of single-frame verification in detecting communication link interruptions. On the other hand, for implicit anomalies where data frames arrive but their timing has systematically shifted, a second detection result characterizing whether the communication link has degraded is determined based on the number of abnormal arrival time intervals between adjacent data frames within a preset time window. This quantifies the consistency of inter-frame time, overcoming the deficiency of single-frame verification in addressing timing degradation issues. Finally, the first and second detection results are combined to generate a comprehensive detection result of the overall health status of the communication link. As can be seen, this application ensures the continuity of detection by continuously acquiring data frames, covers interruption detection with idle duration, covers degradation detection with arrival time interval, and organically integrates the two. This directly overcomes the shortcomings of existing single-frame verification schemes, which can only handle the single anomaly of frame content corruption and cannot comprehensively monitor the problem. It achieves comprehensive monitoring of multiple types of anomalies, such as complete communication link interruption and timing degradation, and significantly improves the comprehensiveness and reliability of communication link monitoring in high reliability scenarios. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a flowchart illustrating a communication link anomaly detection method provided in this application; Figure 2 This is a flowchart illustrating the process of acquiring data frames provided in this application; Figure 3 This is a flowchart illustrating a process for determining a first test result provided in this application; Figure 4 This is a flowchart illustrating a method for determining a second test result provided in this application; Figure 5 This is a schematic diagram of the structure of a communication link anomaly detection device provided in this application; Figure 6 This is a schematic diagram of the structure of a computer device provided in this application. Detailed Implementation
[0020] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0021] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0022] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0023] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."
[0024] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0025] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0026] Optical serial communication is a highly reliable communication method widely used in industrial control, power automation, and other fields. Using an optical fiber serial communication link as the physical medium, it carries digital data using optical signals and offers advantages such as strong resistance to electromagnetic interference, long transmission distance, and excellent electrical isolation. In typical applications, the main control unit and the execution unit transmit control frames via a fixed baud rate optical serial link (e.g., 5 Mbps) at a fixed period (e.g., 50 μs), requiring extremely high real-time performance and reliability.
[0027] A typical optical serial transceiver system consists of two parts: a transmitter and a receiver. The transmitter encapsulates user data bytes into frames (adding frame header identifiers, checksum bytes, and frame trailer identifiers), upscales the clock content using 4B5B encoding, and then modulates it using NRZI (Non-Return-to-Zero Inverted) before the optical transmitter module drives the fiber optic serial communication link for transmission. The receiver converts the optical signal into an electrical signal using an optical receiver module. After NRZI decoding, frame boundary detection, and 4B5B decoding, the original data bytes are recovered and output to the user logic. The transmission and reception process operates in a dual-clock domain: the receive sampling clock (e.g., 50 MHz) is responsible for oversampling and decoding the serial bitstream, while the output clock (e.g., 100 MHz) is responsible for delivering the verified frame data to the user logic.
[0028] Research has revealed that in the process of detecting fiber optic serial communication links in optical transceiver systems, traditional solutions mostly detect whether the content of a single frame is correct. They cannot detect the important early characteristic of communication link degradation, which is that the frame arrives but the frame interval has been systematically shifted. They also cannot identify diverse abnormal manifestations such as communication terminals and communication link degradation, resulting in incomplete link status monitoring and affecting the guarantee of communication real-time performance and stability.
[0029] To overcome the above-mentioned drawbacks, in an exemplary embodiment, such as Figure 1 As shown, a method for detecting anomalies in a communication link is provided. Taking the application of this method to the receiving end as an example, the method includes the following steps: S101 continuously acquires data frames from the communication link.
[0030] A communication link refers to a physical or logical connection channel used to transmit data signals. In high-reliability scenarios such as industrial control and power automation, fiber optic serial communication can be used to ensure data transmission stability and anti-interference capabilities.
[0031] A data frame is a data unit with a specific format and structure transmitted in a communication link. A data frame may contain a frame header, data payload, checksum, etc., used to carry valid information and perform error detection.
[0032] Different implementation methods can be adopted to continuously acquire data frames from the communication link, depending on the resource and real-time requirements of the optical serial transceiver system. For example, one approach is to configure a dedicated hardware receiver designed to continuously monitor the raw signals on the communication link and seamlessly pass the received data frames to the receiving end's processing unit via an internal buffer or direct memory access, thus achieving uninterrupted data frame capture. Another approach uses a software polling mechanism, where the processing unit actively checks the receive buffer of the communication interface at fixed time intervals. Once a new frame is detected, it is immediately read and the flag is cleared, and data frames are continuously acquired by repeatedly executing the polling loop. Alternatively, an interrupt-driven approach can be used: after the communication interface completes the reception of a frame, a hardware interrupt is triggered. The interrupt service routine then reads the data frame and hands it over to the main processing logic. After the interrupt returns, the optical serial transceiver system continues to wait for the next interrupt, ensuring timely response to each data frame. These three methods, from the perspectives of underlying data flow, active periodic checking, and event-triggered response, respectively, achieve continuous acquisition of data frames from the communication link.
[0033] As an optional implementation, the process of acquiring data frames in step S101 above can be further refined. For example... Figure 2 As shown, it includes the following steps: S201 filters the original signal continuously output from the communication link to obtain the filtered signal.
[0034] The raw signal refers to the unprocessed electrical signal directly output by the physical layer of the communication link. In optical serial communication scenarios, the optical receiving module converts the optical signal transmitted through the optical fiber into an electrical signal and outputs it to the FPGA or processor as the raw serial bit stream signal. This raw signal contains noise and glitches introduced by factors such as fiber bending, connector aging, and electromagnetic interference, and cannot be directly used for data recovery.
[0035] The filtered signal refers to the clean digital waveform output after the original signal has been filtered. This filtered signal has largely removed noise and glitches, and its level transitions are clearly discernible. It accurately reflects the original bitstream information sent by the transmitter and is an effective input for the decoding stage.
[0036] The original signal can be de-jitter filtered to eliminate high-frequency noise and narrow pulse spikes, resulting in a filtered signal.
[0037] As an optional implementation, a three-stage dejitter filtering method is used to process the original signal. Through multi-stage majority decision or delay comparison, transitions with a width less than a set threshold are considered invalid and filtered out, retaining only the continuous and stable level state, thereby obtaining a clean and clear digital waveform (i.e., the filtered signal), providing a reliable input for subsequent decoding.
[0038] S202 decodes the filtered signal to obtain the decoded data stream.
[0039] The decoded data stream refers to the original binary data stream recovered after decoding. This decoded data stream has been restored to the original data byte sequence before the sending end framing, but at this time the start and end positions of the data frame have not yet been determined, and the boundaries of the data frame are unknown in the stream.
[0040] The filtered signal is decoded from the line-coded format into the original binary data stream to obtain the decoded data stream.
[0041] As an optional implementation, the decoding includes two sub-steps: NRZI decoding and 4B5B decoding. NRZI decoding restores the non-return-to-zero inverted encoded signal to a binary bit stream; 4B5B decoding converts every 5 bits of encoded data into 4 bits of original data to recover the original data byte sequence.
[0042] S203 performs frame boundary identification on the decoded data stream to obtain the identified data frame.
[0043] The identified data frame refers to a complete data frame with clear start and end boundaries, segmented from a continuous data stream after frame boundary identification. This identified data frame has a complete structure, including a frame header, data payload, and frame trailer, but it has not yet undergone integrity verification, and the correctness of its content is uncertain.
[0044] In the decoded data stream, the start and end positions of a frame are detected and determined to complete frame boundary identification, thereby obtaining the identified data frame. One feasible approach is to identify frame boundaries by detecting frame header and frame tail identifiers: when a frame header identifier is detected in the data stream, the position is marked as the start of a frame; when a frame tail identifier is detected, the position is marked as the end of a frame, thus segmenting independent data frames from the continuous data stream.
[0045] S204, perform integrity verification on the identified data frame, determine the identified data frame that passes the integrity verification as the final data frame, and determine the arrival time of the data frame.
[0046] Integrity verification is performed on the content of the identified data frames. One possible approach is to use a cumulative checksum method for integrity verification. Specifically, the sending end performs a cumulative checksum calculation on the data payload during framing and appends the result to the frame; the receiving end performs the same cumulative checksum calculation on the received data payload and compares it with the checksum carried in the data frame. If they match, the integrity check passes, indicating that the data frame has not been corrupted during transmission; if they do not match, the integrity check fails, and the data frame is considered an erroneous frame and discarded. Identified data frames that pass the integrity check are considered final data frames whose content is confirmed to be correct and can be used for subsequent processing, and their arrival time is determined.
[0047] As another optional implementation, the original signal is subjected to three-level jitter filtering, NRZI decoding, frame boundary detection, 4B5B decoding and integrity verification, and the frame integrity verification result, frame validity flag (i.e. data frame that has passed integrity verification) and frame arrival time (i.e. arrival time, which can be determined by the global counter value) are provided to the anomaly detection engine.
[0048] The above technical solution effectively addresses issues such as noise, signal distortion, and data errors in the communication link during continuous data frame acquisition. Filtering the original signal significantly improves signal quality and reduces the impact of noise on data extraction. Decoding ensures the correct recovery of the digital data stream from the physical signal. Frame boundary identification guarantees the integrity and independence of data frames, preventing data confusion. Finally, the integrity verification mechanism effectively eliminates damaged or erroneous data frames, ensuring that only high-quality, error-free data frames are used for subsequent anomaly detection. Simultaneously, accurately recording the arrival time of data frames provides accurate input for subsequent time-based anomaly detection. Therefore, this solution greatly improves the accuracy and reliability of data frame acquisition, making communication link interruption and degradation detection based on these data frames more accurate and effectively avoiding false alarms or missed alarms caused by data quality issues.
[0049] S102, based on the idle duration after the most recent received data frame, determine the first detection result characterizing whether the communication link is interrupted.
[0050] The idle duration refers to the time during which the communication link has not received any data frames since the last successful reception of a data frame. This idle duration is used to assess the activity status of the communication link.
[0051] The first detection result refers to the conclusion drawn based on the idle duration to determine whether the communication link is interrupted. This first detection result can indicate whether the communication link is in a normal working state or an interrupted state.
[0052] The idle duration since the last received data frame can be determined by maintaining a timer. For example, the timer is reset whenever the receiver successfully receives a data frame. Subsequently, for the current moment, if no data frame has been received, the timer continues to accumulate from the arrival time of the previous data frame (i.e., the time of the last received data frame), and this accumulated time is used as the idle duration. When communication link interruption detection is required, the value of this timer is read, and the first detection result is determined based on this value.
[0053] S103, determine the second detection result characterizing whether the communication link has degraded based on the number of times the arrival time interval between adjacent data frames is abnormal within a preset time window.
[0054] The preset time window refers to a specific time period used to observe and statistically analyze frame reception. It can be a fixed duration, such as 1 second or 500 milliseconds, or a period that is dynamically adjusted according to the characteristics of the communication link.
[0055] Adjacent data frames refer to two data frames received consecutively in chronological order on a communication link, such as frame N and frame N+1.
[0056] The arrival time interval (ATU) is the difference between the times when two adjacent data frames are received in a communication link. This ATU reflects the regularity and stability of data frame transmission. An abnormal ATU means that the ATU deviates from the preset normal range.
[0057] The second detection result refers to the conclusion drawn from the arrival time interval between adjacent data frames to determine whether the communication link has degraded. This second detection result can indicate whether the communication link is in normal working condition or has experienced performance degradation.
[0058] In industrial settings, communication link (e.g., fiber optic) anomalies do not always manifest as complete link outages. Besides total link failure (i.e., complete communication link interruption), other typical degradation scenarios include: fiber bending and aging of optical connectors leading to signal quality degradation and inter-frame timing jitter; aging of the transmitting end's crystal oscillator or clock module causing frame transmission period offsets; and power supply interference or transient strong magnetic fields causing periodic data errors. In these degradation scenarios, frame data can still reach the receiving end, and single-frame verification may still pass, but the inter-frame arrival timing has exceeded the preset range (i.e., inter-frame timing degradation, for example, a nominal 50μs interval becoming more than 60μs). If not identified in time, this may lead to misjudgments in the upper-layer control logic.
[0059] To address this, a second detection result characterizing whether the communication link has degraded can be determined based on the number of abnormal arrival time intervals between adjacent data frames within a preset time window. One feasible approach is to first calculate the difference in timestamps between two consecutive data frames by recording the arrival timestamp of each data frame (the arrival timestamp is recorded when each data frame is successfully received), thus obtaining the arrival time interval between adjacent data frames. Within the preset time window, anomalies are assessed for each pair of adjacent data frames to determine whether the arrival time interval deviates from the nominal period, and the number of abnormal frame intervals (i.e., the number of abnormal arrival time intervals) is accumulated to further determine whether the communication link has degraded.
[0060] One possible approach is to define a preset time window by dividing the window with a fixed time boundary (e.g., every 250μs from time 0). When each preset time window opens, the anomaly counter is reset to zero. Then, anomaly detection is performed on each time interval within the preset time window. If an anomaly is detected, the count is incremented by 1. When the preset time window ends, the accumulated count is compared with a preset count threshold. If the count reaches or exceeds the preset count threshold, it is determined that the communication link has degraded, thus obtaining a second detection result characterizing the communication link degradation.
[0061] Another possible approach is to maintain a dynamically sliding time window (i.e., a preset time window) that slides with the arrival of data frames. Whenever a new frame arrives, the arrival time interval between it and the previous frame is calculated and an anomaly is determined. Then, the current time is subtracted from the preset window duration as the starting boundary of the window. Only the anomaly counts that fall within the preset time window are retained, while old records outside the preset time window are discarded. The system also checks in real time whether the cumulative number of anomalies within the current preset time window has reached a preset threshold. Once the threshold is reached, a degradation decision is triggered immediately without waiting for the fixed window boundary to end.
[0062] Another feasible approach is to accumulate the total number of frame intervals within a preset time window. Based on this, at the end of the preset time window, the ratio of the number of abnormal frame intervals to the total number of frame intervals is calculated as the anomaly rate. When this anomaly rate exceeds a preset anomaly rate threshold, communication link degradation is determined; otherwise, the communication link timing is considered normal (i.e., no degradation). By measuring the proportion of anomalies among all frame intervals within the preset time window, stable decision-making capability can be maintained even in scenarios with varying communication rates or a variable number of frames within the preset time window. For example, when the total number of frames within the preset time window is small, even with fewer anomalies, the anomaly rate may be high, thus triggering timely degradation determination; while when the total number of frames within the window is large, occasional small anomalies will be diluted, avoiding false alarms caused by the absolute number accumulating to a fixed threshold. Through the above anomaly rate-based decision method, the link degradation detection requirements under different frame rate conditions can be addressed more robustly.
[0063] Regardless of the implementation method used, by setting a time window and the number of accumulated anomalies, the determination of the second detection result depends on both the density of the occurrence of time-series anomalies and the validity period of the statistical time, thereby effectively filtering out occasional single disturbances and ensuring that the determination of communication link degradation has statistical reliability and real-time response capability.
[0064] S104. Based on the first and second detection results, determine the comprehensive detection result of the communication link.
[0065] The comprehensive test result refers to the final judgment made on the overall operating status of the communication link by combining the first and second test results. This comprehensive test result can characterize whether the communication link is in a normal, interrupted, or degraded state.
[0066] By integrating two different types of first and second detection results, a comprehensive detection result for the communication link is determined, providing a complete assessment of the communication link status. One feasible approach is to set a rule that if the first detection result indicates a communication link interruption, the comprehensive detection result is determined to be an anomaly, regardless of the second detection result. Alternatively, if the first detection result indicates an uninterrupted communication link, but the second detection result indicates communication link degradation, the comprehensive detection result is also determined to be an anomaly. Only when both the first and second detection results indicate a normal communication link is the comprehensive detection result determined to be a normal communication link. This combined judgment mechanism can cover a variety of possible communication link anomalies.
[0067] As an optional implementation, this method is applied to control-type serial communication scenarios using a 5Mbps optical fiber as the physical medium. The transmitting end periodically sends data frames to the receiving end at fixed time intervals (approximately 50μs); the receiving end needs to monitor the health status of the communication link in real time, promptly report any abnormalities in the communication link to trigger upper-layer protection actions, and automatically remove the abnormality flag after the communication link returns to normal.
[0068] By introducing the detection of idle duration and the arrival time interval of adjacent data frames through the above scheme, it is possible not only to detect extreme disconnection scenarios with no frames at all (i.e., communication link interruption), but also to identify intermittent anomalies where frames arrive but their timing has degraded (i.e., communication link degradation). This allows the optical serial transceiver system to detect potential problems earlier and take preventative measures, significantly improving the stability and availability of the optical serial transceiver system in high-reliability scenarios. This multi-dimensional, hierarchical detection strategy extends the monitoring of the communication link beyond simple frame content verification to a comprehensive assessment of link activity and transmission stability, effectively solving the technical problem that existing single-frame verification schemes cannot meet the comprehensive monitoring requirements.
[0069] Based on the above embodiments, in an exemplary embodiment, the process of determining the first detection result in step S102 is further refined. Optionally, such as Figure 3 As shown, it includes the following steps: S301, determine the idle duration based on the current time and the arrival time of the most recently received data frame.
[0070] The idle duration refers to the time elapsed from the moment the last valid data frame was successfully received to the moment the current detection is performed, which is also the silent duration of the communication link.
[0071] The arrival time of each data frame can be recorded using timestamps, and the idle duration can be calculated by subtracting the most recent timestamp (i.e., the arrival time of the most recently received data frame) from the current system time (i.e., the current moment) when needed; alternatively, a timer can be set up and reset each time a data frame is received, and the current count value of the timer is the idle duration.
[0072] S302, compare the idle duration with the preset time threshold to obtain the comparison result.
[0073] The preset time threshold refers to a predetermined time length, representing the maximum silent time allowed for the communication link under normal working conditions.
[0074] The comparison result refers to the result obtained by comparing the idle duration with the preset time threshold.
[0075] The idle duration is compared with a preset time threshold to obtain a comparison result where the idle duration is not less than the preset time threshold, or a comparison result where the idle duration is less than the preset time threshold.
[0076] S303, Based on the comparison results, determine the first detection result characterizing whether the communication link is interrupted.
[0077] If the comparison result shows that the idle duration exceeds a preset time threshold, it indicates that the communication link has not transmitted data for a long time, and the first detection result indicates that the communication link has been interrupted; otherwise, the first detection result indicates that the communication link has not been interrupted. The first detection result can be a Boolean value (e.g., true / false) or a status indicator (e.g., interrupted / not interrupted).
[0078] As an optional implementation, after the communication link successfully receives a data frame for the first time (link_ok set), a monotonically increasing timeout counter is started. This timeout counter accumulates in units of system clock cycles, and its count value represents the idle duration since the most recent valid data frame (integrity verification passed and frame type matches expectations) was received. Specifically, whenever a new valid data frame is successfully received, the difference between the current counter value and the counter value latched at the time the valid data frame arrived is the idle duration. The timeout counter is reset after each valid data frame is received. The idle duration (i.e., the current accumulated value of the timeout counter) is compared with a preset time threshold (corresponding to the maximum allowed idle time, such as 250μs). If the idle duration is not greater than the preset time threshold, the comparison result is that the communication link has not timed out; if the idle duration exceeds the preset time threshold, the comparison result is that the communication link has timed out. When the comparison result indicates that the communication link has timed out, the timeout counter is set to the timeout flag, i.e., the first detection result indicates that the communication link is interrupted. Specifically, if the accumulated timeout counter reaches the preset timeout threshold (i.e., the preset time threshold), the timeout counter is reset to the preset timeout flag. (i.e., the number of timeout clock cycles, a positive integer, typically 12500) clock cycles (corresponding to duration) (i.e., the timeout threshold duration) will trigger the timeout flag; when the comparison result indicates that the communication link has not timed out, the timeout counter will not trigger the timeout flag, and the first detection result indicates that the communication link has not been interrupted. Furthermore, this timeout counter does not start counting during the power-on initialization phase (i.e., when link_ok is low and the communication link has not yet established a valid connection), thus effectively avoiding false triggering during the power-on link establishment phase through the link_ok gating mechanism, ensuring that timeout detection only starts working after a valid communication link has been established. , This is the sampling clock frequency, typically 50MHz.
[0079] The present application's solution, through continuous tracking of data frame reception, calculates the idle duration since the arrival of the most recent data frame and accurately determines whether the communication link is interrupted based on this. This method avoids fuzzy judgments, making the detection of communication link interruptions more timely and accurate, thereby enabling faster response to link faults and improving the reliability and stability of the optical serial transceiver system.
[0080] Based on the above embodiments, in an exemplary embodiment, the process of determining the second detection result in step S103 is further refined. Optionally, as... Figure 4 As shown, it includes the following steps: S401, for each adjacent data frame, determine the arrival time interval of adjacent data frames based on the arrival time of adjacent data frames.
[0081] The arrival time interval refers to the time difference between the next data frame and the previous data frame, calculated based on the arrival times of adjacent data frames, to reflect the real-time transmission characteristics of the link.
[0082] The arrival time interval can be obtained by reading the timestamp of each data frame received (recording the arrival time of each data frame) and then subtracting the timestamp of the previous data frame from the timestamp of the current data frame; or by measuring the time difference between the completion time of receiving two consecutive data frames (i.e., the arrival time of the data frames) using a hardware timer or counter to determine the arrival time interval.
[0083] S402, based on the arrival time interval and the preset time interval, determine the detection result that characterizes whether the frame interval is abnormal.
[0084] The preset time interval refers to a predetermined time length, which can be a value or a range. The preset time interval is determined according to the frame transmission period or average frame interval specified in the communication protocol.
[0085] The preset time interval is set to a fixed value. The arrival time interval is compared with the preset time interval. If the arrival time interval exceeds the preset time interval, the detection result is determined to be an abnormal frame interval. Otherwise, the detection result is determined to be a normal frame interval. Alternatively, the preset time interval is set to a range. It is determined whether the arrival time interval is within the range of the preset time interval. If the arrival time interval falls outside the range of the preset time interval, the detection result is determined to be an abnormal frame interval. Otherwise, the detection result is determined to be a normal frame interval.
[0086] S403, count the number of times all detection results under the preset time window indicate frame interval anomalies.
[0087] To avoid misjudgments caused by momentary jitter or sporadic anomalies, the number of all frame interval anomalies is continuously counted within a preset time window. One possible approach is to maintain a buffer or queue to store the detection results of each frame interval anomaly within the preset time window. When a new detection result is generated, it is added to the buffer, and the oldest detection result is removed. Then, the buffer is traversed to count the number of frame interval anomalies. Alternatively, a counter can be used, which is reset to zero at the beginning of the preset time window and incremented whenever a frame interval anomaly is detected. A timer is used to manage the start and end of the preset time window, thereby determining the number of times all detection results represent frame interval anomalies within the preset time window.
[0088] S404, based on the number of times and a preset number of times threshold, determine a second detection result characterizing whether the communication link has degraded.
[0089] The preset threshold is an integer value representing the upper limit of the number of frame interval anomalies allowed within a preset time window. The preset threshold can be dynamically adjusted based on the actual application scenario and the required tolerance for link degradation.
[0090] The number of times can be compared with a preset threshold. If the number of times is greater than or equal to the preset threshold, the second detection result is determined to be communication link degradation; otherwise, the second detection result is determined to be communication link non-degradation.
[0091] As an optional implementation, a 64-bit continuous global counter is used. Using a 64-bit global continuous counter value as a baseline, the current counter value is latched each time a valid data frame is received. (i.e., the counter latch value when the most recent valid frame arrived), calculate the arrival time difference between adjacent frames (i.e., the arrival time interval). In the statistics window (i.e., the preset time window) The cumulative number of abnormal frame intervals within the duration of the statistical window. ;when Not less than the preset threshold number of times (Right now Preset number of times threshold In case 2), the intermittent abnormality flag is set, where, , This is the number of clock cycles in the statistical window, a positive integer, typically 12500.
[0092] As another alternative implementation, the first The expression for the frame interval (and arrival time interval) of a valid data frame is: ; The following conditions must be met: ,in, This is the nominal interval clock cycle number, a positive integer, with a typical value of 2500; An additional judgment threshold (number of cycles) is added for frame interval anomalies. It is a positive integer, with a typical value of 500.
[0093] Through the above technical solution, this application can effectively avoid misjudgments caused by occasional instantaneous jitter or brief delays in the communication link. By introducing a preset time window and an anomaly count mechanism, a comprehensive judgment on whether the communication link is in a degraded state can be made, effectively filtering out transient and non-continuous anomalies, thereby more accurately identifying the continuous degradation trend of the communication link, improving the accuracy and reliability of the second detection result, avoiding false alarms caused by occasional events, and making the judgment of the communication link degradation state more stable and reliable.
[0094] Based on the above embodiments, in an exemplary embodiment, the process of determining the comprehensive detection result in step S104 is further refined. Optionally, it includes the following steps: when the first detection result indicates that the communication link is interrupted, or when the second detection result indicates that the communication link is degraded, the comprehensive detection result of the communication link is determined to indicate that the communication link is abnormal; when the first detection result indicates that the communication link is not interrupted, and when the second detection result indicates that the communication link is not degraded, the comprehensive detection result of the communication link is determined to indicate that the communication link is normal.
[0095] If either the first or second detection result indicates a problem with the communication link (i.e., communication link interruption or degradation), the overall detection result of the communication link is judged as abnormal. Conversely, only when both the first and second detection results indicate that the communication link is normal is the overall detection result judged as normal. This logical combination method ensures comprehensive coverage and rapid response to the communication link status, avoids blind spots that may be caused by a single detection dimension, and thus can reflect the true operating status of the communication link in a timely and accurate manner.
[0096] As an optional implementation, the timeout flag and the intermittent abnormal flag are logically ORed and combined to output a unified rx_abnormal_50m signal. An alarm is triggered by either mechanism, thus reporting the abnormality.
[0097] As another optional implementation, when the comprehensive detection results indicate that the communication link is abnormal, the method further includes: counting the number of target data frames received consecutively within a subsequent preset time window; the target data frame refers to a data frame whose idle duration at the current moment is not greater than a preset time threshold and whose frame interval is normal; when the number is not less than a preset number threshold, it is determined that the communication link has returned to normal.
[0098] The preset threshold number refers to the minimum number of target data frames that must be continuously received to determine if the communication link has been stably restored. This preset threshold number can be a specific integer value or a percentage of the theoretical maximum number of frames within a preset time window.
[0099] When the comprehensive detection results indicate that the communication link is in an abnormal state, a recovery decision mechanism is initiated to confirm whether the communication link has recovered from the abnormality. Within a subsequent preset time window, the number of continuously received target data frames is counted and compared with a preset threshold. Only when the number is not less than the preset threshold is the communication link considered truly recovered. One possible approach is to maintain a counter: when the subsequent preset time window opens, the counter is reset to zero. Afterward, for each received data frame, it is determined whether the current idle duration is not greater than a preset time threshold (i.e., no timeout interruption has occurred), and whether the arrival time interval between the current data frame and the previous data frame is not greater than a preset time interval. If both conditions are met, the data frame is considered a target data frame (i.e., normal data), and the counter is incremented by 1. If either condition is not met (i.e., idle duration timeout, frame loss, or abnormal frame interval), the counter is immediately reset to zero, indicating a continuous normal reception interruption, and counting must restart. When the counter value reaches the preset threshold, the communication link is considered to have recovered (recovery requires continuous reception within the subsequent preset time window). (If the frame contains normal data), then clear the exception flag and exit the exception state.
[0100] As another optional implementation, the restoration decision mechanism needs to meet the following requirements: Only then can it be confirmed that the communication link has been restored to normal, among which, This is a count of normal data within a preset time window. The number of consecutive normal frames required to restore the judgment, i.e., the preset number threshold, is a positive integer, with a typical value of 4.
[0101] Through the aforementioned recovery decision mechanism, this application ensures that the decision process for restoring the communication link from an abnormal state to a normal state possesses high reliability and strong anti-interference capability. Specifically, this mechanism requires that continuously received data frames simultaneously meet two conditions: the idle duration at the current moment is less than a preset time threshold (i.e., the link is not in an interrupted or disconnected state) and the frame interval is normal (i.e., the timing has returned to the normal range). This ensures that the link has been restored to stability in both the interruption and timing dimensions. By continuously counting to reach a preset number threshold, the risk of false recovery caused by occasional normal frames is effectively filtered out. Thus, this application achieves accuracy and stability in the decision-making of abnormal communication link recovery, avoiding repeated oscillations of the communication link state at the boundary between abnormal and normal states. This allows the system to reliably identify whether the communication link has truly recovered even under complex engineering scenarios such as fiber bending, optical connector aging, and clock drift, thereby ensuring that the upper-layer control logic makes correct decisions based on the accurate communication link state, significantly improving the robustness and availability of the system.
[0102] Through the above technical solution, this application effectively integrates two independent anomaly detection results: communication link interruption and degradation. Through logical judgment, if either detection result indicates a problem with the link, the overall state of the communication link can be quickly determined to be abnormal. Conversely, only when both detection results indicate that the link is normal is it determined to be normal. This explicit judgment mechanism avoids complex manual analysis or fuzzy judgment of multiple detection results, significantly improving the accuracy and real-time performance of communication link anomaly identification, ensuring that the system can respond to link problems promptly, thereby enhancing the system's reliability and stability.
[0103] Based on the above embodiments, in an exemplary embodiment, after performing step S104, the method further includes the following steps: in the output clock domain, performing multi-shot continuous sampling on the comprehensive detection result representing communication link anomalies from the sampling clock domain to obtain multi-shot sampled values; in response to the consistency of the multi-shot sampled values, outputting sampled values.
[0104] The output clock domain refers to the clock domain used to output the final detection result. The output clock domain can be generated by an independent crystal oscillator, phase-locked loop, or digital clock manager, or obtained by dividing the master clock.
[0105] The sampling clock domain refers to the clock domain used to sample and process communication link data and generate comprehensive detection results. The sampling clock domain can be generated by an independent crystal oscillator, phase-locked loop, or digital clock manager, or obtained by dividing the master clock.
[0106] Multi-shot sampling value refers to the result of multiple consecutive samplings of the comprehensive detection result signal from the sampling clock domain in the output clock domain.
[0107] After generating a comprehensive detection result characterizing communication link anomalies in the sampling clock domain, this result is not output immediately but is sent to the output clock domain for processing. In the output clock domain, the comprehensive detection result is sampled continuously for multiple cycles to address metastability issues that may arise from signal transmission between asynchronous clock domains and to filter out transient interference. Only when the multiple sampled values (i.e., the multi-cycle sampled values) are consistent is it considered that the comprehensive detection result has been stably and reliably synchronized from the sampling clock domain to the output clock domain. At this point, the stable sampled value is output as the final comprehensive detection result. This method ensures the accuracy and stability of the output comprehensive detection result, avoids misjudgments caused by clock domain differences or transient interference, and thus improves the reliability of the entire system.
[0108] As an optional implementation, the method operates in a dual-clock domain, wherein the sampling clock (sampling clock frequency) (50MHz) is used for serial data reception and anomaly detection operations; the output clock (sampling clock frequency) is... (≥100MHz) is used to output data frames to user logic. The exception flag must be reliably used in both clock domains. The exception flag (i.e., the integrated detection result characterizing the communication link exception) is continuously sampled for two clock cycles with the output clock. The output register is only updated when the two sample values are equal, thereby suppressing the propagation of short pulses caused by metastability and ensuring the consistency of cross-domain flag logic.
[0109] Through the above technical solution, this application effectively solves the metastability problem and transient interference that may occur when transmitting comprehensive detection results between different clock domains. By performing multi-sampling continuous sampling of the comprehensive detection results and verifying their consistency, the output detection results are ensured to be stable and reliable, significantly improving the accuracy and anti-interference capability of communication link anomaly detection results, avoiding system misjudgment or unnecessary response due to signal instability, thereby making subsequent processing based on the comprehensive detection results more robust and reliable.
[0110] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0111] Corresponding to the communication link anomaly detection method in the above embodiments, an exemplary embodiment provides a communication link anomaly detection device. For ease of explanation, only the parts related to the embodiments of this application are shown. Figure 5 As shown, the anomaly detection device for this communication link includes: The receiving module 501 is used to continuously acquire data frames from the communication link; The first detection module 502 is used to determine a first detection result characterizing whether the communication link is interrupted based on the idle duration after the most recent received data frame. The second detection module 503 is used to determine a second detection result characterizing whether the communication link has degraded based on the number of abnormal arrival time intervals of adjacent data frames under a preset time window. The integrated detection module 504 is used to determine the integrated detection result of the communication link based on the first detection result and the second detection result.
[0112] As an optional implementation, the first detection module 502 is specifically used to: determine the idle duration based on the current time and the arrival time of the most recently received data frame; compare the idle duration with a preset time threshold to obtain a comparison result; and determine a first detection result characterizing whether the communication link is interrupted based on the comparison result.
[0113] As an optional implementation, the second detection module 503 is specifically used to: for each adjacent data frame, determine the arrival time interval of adjacent data frames based on the arrival time of adjacent data frames; determine the detection result characterizing whether the frame interval is abnormal based on the arrival time interval and a preset time interval; count the number of times all detection results characterize the frame interval abnormality under the preset time window; and determine the second detection result characterizing whether the communication link is degraded based on the number of times and a preset number threshold.
[0114] As an optional implementation, when the comprehensive detection results indicate that the communication link is abnormal, the device further includes: a quantity statistics module, used to count the number of target data frames received consecutively within a subsequent preset time window; the target data frame refers to a data frame whose idle duration at the current moment is not greater than a preset time threshold and whose frame interval is normal; and a recovery module, used to determine that the communication link has returned to normal when the number is not less than a preset quantity threshold.
[0115] As an optional implementation, the comprehensive detection module 504 is specifically used to: determine that the comprehensive detection result of the communication link indicates an abnormal communication link when the first detection result indicates that the communication link is interrupted, or when the second detection result indicates that the communication link is degraded; and determine that the comprehensive detection result of the communication link indicates that the communication link is normal when the first detection result indicates that the communication link is not interrupted and when the second detection result indicates that the communication link is not degraded.
[0116] As an optional implementation, the receiving module 501 is specifically used to: filter the original signal continuously output by the communication link to obtain a filtered signal; decode the filtered signal to obtain a decoded data stream; identify the frame boundaries of the decoded data stream to obtain an identified data frame; perform integrity verification on the identified data frame, determine that the identified data frame that passes the integrity verification is the final data frame, and determine the arrival time of the data frame.
[0117] As an optional implementation, the device further includes: a sampling module, used to perform multi-shot continuous sampling of the comprehensive detection result representing communication link anomalies from the sampling clock domain in the output clock domain to obtain multi-shot sampled values; and an output module, used to output sampled values in response to the consistency of the multi-shot sampled values.
[0118] It should be noted that the information interaction and execution process between the modules in the above-mentioned communication link anomaly detection device are based on the same concept as the method embodiment of this application. For details on their specific functions and technical effects, please refer to the method embodiment section, which will not be repeated here.
[0119] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 6As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores data required for an anomaly detection method in the communication link. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements an anomaly detection method for the communication link.
[0120] Those skilled in the art will understand that Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0121] In one exemplary embodiment, a computer-readable storage medium is provided that stores a computer program, which, when executed by a processor, can implement the steps in the various method embodiments described above.
[0122] In one exemplary embodiment, a computer program product is provided that, when run on a mobile terminal, enables the mobile terminal to perform the steps described in the various method embodiments.
[0123] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying the computer program code to a photographic device / terminal device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks.
[0124] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0125] Those skilled in the art will 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, or a combination of computer software and electronic hardware. 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.
[0126] In the embodiments provided in this application, it should be understood that the disclosed apparatus / network devices and methods can be implemented in other ways. For example, the apparatus / network device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0127] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0128] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A method of anomaly detection for a communication link, the method comprising: include: Continuously acquire data frames from the communication link; Based on the idle duration since the most recent received data frame, a first detection result characterizing whether the communication link is interrupted is determined; Based on the number of abnormal arrival time intervals between adjacent data frames within a preset time window, a second detection result characterizing whether the communication link has degraded is determined; Based on the first detection result and the second detection result, the comprehensive detection result of the communication link is determined.
2. The abnormality detection method of a communication link according to claim 1, wherein The step of determining a first detection result characterizing whether the communication link is interrupted based on the idle duration after the most recent received data frame includes: The idle duration is determined based on the current time and the arrival time of the most recently received data frame; The idle duration is compared with a preset time threshold to obtain a comparison result; Based on the comparison results, a first detection result characterizing whether the communication link is interrupted is determined.
3. The method of claim 1, wherein the step of detecting the abnormality of the communication link comprises the steps of: determining whether the communication link is abnormal based on the number of times of the communication error. The step of determining a second detection result characterizing whether the communication link has degraded based on the number of abnormal arrival time intervals between adjacent data frames within a preset time window includes: For each adjacent data frame, the arrival time interval between adjacent data frames is determined based on the arrival time of the adjacent data frames. Based on the arrival time interval and the preset time interval, a detection result indicating whether the frame interval is abnormal is determined; The number of times that all the detection results under the preset time window represent the frame interval anomaly is counted; Based on the number of times and a preset threshold number of times, a second detection result characterizing whether the communication link has degraded is determined.
4. The communication link anomaly detection method as described in claim 3, characterized in that, When the comprehensive detection results indicate an anomaly in the communication link, the method further includes: Within the subsequent preset time window, the number of consecutively received target data frames is counted; the target data frame refers to the data frame whose idle duration at the current moment is not greater than a preset time threshold and whose frame interval is normal. When the number is not less than a preset threshold, the communication link is determined to have returned to normal.
5. The communication link anomaly detection method according to any one of claims 1-4, characterized in that, Determining the comprehensive detection result of the communication link based on the first detection result and the second detection result includes: When the first detection result indicates that the communication link is interrupted, or when the second detection result indicates that the communication link is degraded, the comprehensive detection result of the communication link indicates that the communication link is abnormal. When the first detection result indicates that the communication link is not interrupted, and when the second detection result indicates that the communication link is not degraded, the comprehensive detection result of the communication link indicates that the communication link is normal.
6. The communication link anomaly detection method according to any one of claims 1-4, characterized in that, The continuous acquisition of data frames from the communication link includes: The original signal continuously output from the communication link is filtered to obtain the filtered signal; The filtered signal is decoded to obtain the decoded data stream; Frame boundary identification is performed on the decoded data stream to obtain the identified data frame; The integrity of the identified data frame is checked, and the identified data frame that passes the integrity check is determined as the final data frame. The arrival time of the data frame is also determined.
7. The communication link anomaly detection method according to any one of claims 1-4, characterized in that, After determining the comprehensive detection result of the communication link, the method further includes: In the output clock domain, the comprehensive detection results representing communication link anomalies from the sampling clock domain are continuously sampled over multiple cycles to obtain multi-cycle sampled values. In response to the fact that all the sampled values are consistent, the sampled value is output.
8. An anomaly detection device for a communication link, characterized in that, include: The receiving module is used to continuously acquire data frames from the communication link; The first detection module is used to determine a first detection result characterizing whether the communication link is interrupted based on the idle duration after the most recent data frame is received. The second detection module is used to determine a second detection result characterizing whether the communication link has degraded based on the number of abnormal arrival time intervals between adjacent data frames within a preset time window. The comprehensive detection module is used to determine the comprehensive detection result of the communication link based on the first detection result and the second detection result.
9. A computer device, characterized in that, The method includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the method as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method as described in any one of claims 1 to 7.