Communication controller error detection method and system based on algorithm optimization
By dynamically adjusting the error detection strategy of the communication controller, the complex error patterns caused by high-bandwidth video streams under resource reuse are resolved, achieving efficient error identification and data integrity assurance, thus ensuring system security and stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 深圳市智为通科技有限公司
- Filing Date
- 2026-04-15
- Publication Date
- 2026-05-19
AI Technical Summary
Existing communication controllers, under resource reuse conditions, cannot effectively cope with the complex error modes caused by data processing delays and signal crosstalk resulting from high bandwidth video streams, leading to a high false negative rate and failing to meet the quality and personal safety requirements of high-value products.
By acquiring real-time operating status parameters of the communication controller, including internal status parameters and external environment parameters, correlation analysis is performed to dynamically adjust the error detection strategy, including switching the detection sensitivity threshold, verification algorithm complexity, and error correction function. A strategy locking mechanism is used to calculate the average value and adjust the strategy when the risk fluctuates drastically.
It significantly improved the efficiency of error identification, reduced the missed detection rate of critical control commands, and ensured production safety and product quality.
Smart Images

Figure CN122064073A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication controller technology, and in particular to a communication controller error detection method and system based on algorithm optimization. Background Technology
[0002] In industrial automation, communication controllers rely on fixed cyclic redundancy check (CRC) checks to detect data transmission errors. With Industry 4.0 upgrades, in addition to traditional low-bandwidth sensor data and control commands, high-bandwidth real-time video streams have been added. To avoid additional wiring and large-scale modifications, existing communication cables and main processing chips can be reused, allowing control commands and video streams to compete for bandwidth on the same cable and for processing time on the same chip.
[0003] However, this resource reuse leads to two new problems: First, under high load, data queuing and blocking occur in the memory buffer, causing data processing latency to fluctuate from microseconds to milliseconds, disrupting the stable timing upon which fixed CRC relies. Second, the high-frequency energy of the video signal causes crosstalk to the control signal, especially during dramatic scene changes, triggering occasional, short-lived consecutive bit flips. This error mode is context-dependent and intermittent. Fixed CRC is designed for traditional random single-bit errors or uniform burst errors, and cannot effectively cope with complex error modes formed by timing jitter and dynamic crosstalk. Its false negative rate can no longer meet the requirements of high-value product quality and personal safety.
[0004] Therefore, existing technologies urgently need an algorithm optimization method that can adaptively adjust the detection strategy according to real-time communication conditions in order to dynamically optimize the verification parameters and ensure the integrity of critical data and system security.
[0005] To address the aforementioned issues, existing technologies urgently need improvement. Summary of the Invention
[0006] In view of the shortcomings of the prior art, this application provides a communication controller error detection method and system based on algorithm optimization, which has the advantage of being able to adaptively adjust the detection strategy and optimize the verification parameters according to the real-time communication conditions, such as the current data traffic, video stream characteristics, and processor load, thereby improving the error identification efficiency.
[0007] Firstly, a communication controller error detection method based on algorithm optimization, the method comprising the following steps: S1: Obtain the real-time operating status parameters of the communication controller. The real-time operating status parameters include internal status parameters reflecting the internal processing resource occupancy and external environmental parameters reflecting the characteristics of external interference sources and the quality of the physical channel. S2: Based on the internal state parameters and the external environment parameters, perform correlation analysis to determine the risk assessment value corresponding to the target control data packet; S3: Based on the risk assessment value, dynamically adjust the error detection strategy for the target control data packet. The adjustment of the error detection strategy includes adjusting the detection sensitivity threshold, switching the complexity of the verification algorithm, or enabling or disabling the error correction function. Specifically, when the risk assessment value crosses the strategy switching threshold multiple times within a preset time window and the fluctuation frequency exceeds a preset frequency threshold, the system enters a strategy locking state, stops switching strategies based on instantaneous changes, calculates the arithmetic mean of the risk assessment value within the time window, determines the target detection strategy based on the arithmetic mean, and after the time window ends, adjusts the current strategy to the target detection strategy all at once, and then exits the strategy locking state.
[0008] Furthermore, the internal state parameters include the memory buffer state and the main processing chip load, and the external environment parameters include the video data stream characteristics and the communication cable signal quality.
[0009] Furthermore, step S1 includes: S11: Obtain the free space size and allocated space size of the memory buffer, calculate the memory occupancy rate, and obtain the memory buffer status; S12: Read the idle task time slice counter of the main processing chip and calculate the load of the main processing chip; S13: By comparing the sum of pixel differences in consecutive video frames, or by detecting the changes in the ratio of I-frames, P-frames, and B-frames output by the video encoder, the dynamics of the video data stream are evaluated to obtain the characteristics of the video data stream. S14: Obtain the instantaneous signal-to-noise ratio of the communication cable to obtain the signal quality of the communication cable.
[0010] Furthermore, step S2 includes: S21: When the memory occupancy rate exceeds a preset occupancy threshold and the screen dynamics are at a preset high dynamic level, increase the weight coefficient of the screen dynamics and decrease other weight coefficients; when the instantaneous signal-to-noise ratio is lower than a preset signal-to-noise ratio threshold, increase the weight coefficient of the normalized instantaneous signal-to-noise ratio and decrease other weight coefficients. S22: Calculate the risk index using the weighted summation formula based on the adjusted weighting coefficients: Risk Index = W_buffer × memory occupancy rate + W_dynamic × screen dynamics + W_cpu × main processing chip load + W_snr × (1 - normalized instantaneous signal-to-noise ratio), where W_buffer is the weighting coefficient assigned to memory occupancy rate, W_dynamic is the weighting coefficient assigned to screen dynamics, W_cpu is the weighting coefficient assigned to main processing chip load, and W_snr is the weighting coefficient assigned to the normalized instantaneous signal-to-noise ratio, and W_buffer + W_dynamic + W_cpu + W_snr = 1; S23: Normalize the risk index to obtain the risk assessment value ranging from 0 to 1.
[0011] Furthermore, in step S3, adjusting the detection sensitivity threshold includes the following steps: S31: When the risk assessment value is less than the first risk threshold, the detection sensitivity threshold is set to the first sensitivity value. Under this setting, the target control data packet is marked as abnormal only when the cyclic redundancy check report is incorrect. S32: When the risk assessment value is between the first risk threshold and the second risk threshold, the detection sensitivity threshold is reduced to the second sensitivity value. Under this setting, if the cyclic redundancy check result is passed and the physical layer detects signal distortion, the target control data packet is marked as suspicious and a second review is triggered; wherein, the second sensitivity value is less than the first sensitivity value.
[0012] Furthermore, in step S3, switching the complexity of the verification algorithm or enabling / disabling the error correction function includes the following steps: S33: When the risk assessment value is greater than the second risk threshold and less than the third risk threshold, perform the first level of enhanced verification: calculate an additional verification code in addition to the standard verification code; S34: When the risk assessment value is between the third risk threshold and the fourth risk threshold, perform the second level of enhanced verification: On the basis of the first level of enhanced verification, a verification polynomial is used for the key control parameters, and the error correction function is temporarily not enabled. S35: When the risk assessment value is greater than the fourth risk threshold, execute the error correction function: send the same key data twice using a duplicate code for the key control parameters.
[0013] Furthermore, after step S35, the method further includes: S36: Set a high-risk intervention threshold, wherein the high-risk intervention threshold is greater than the fourth risk threshold; S37: When the risk assessment value is greater than or equal to the high-risk intervention threshold, an active intervention action is performed.
[0014] Furthermore, in step S37, performing the active intervention includes the following steps: S371: Send a data integrity risk warning to the main control system via an interrupt signal or status register, and record the risk assessment value in the system log; S372: Before the target control data packet is completely processed, a retransmission request frame is sent to the sending end; S373: When processing the target control data packet, the processing task of the target control data packet is promoted to the highest priority by modifying the priority parameter in the task scheduler.
[0015] Furthermore, step S33 includes the following steps: S331: When the risk assessment value is greater than the second risk threshold and less than the third risk threshold, obtain the current remaining computing power of the communication controller; S332: Predict the expected computing power cost after performing the first-level enhanced verification. If the expected computing power cost is greater than the current remaining computing power, maintain the current verification algorithm complexity. S333: Send a speed-down command to the source of the video data stream to reduce the instantaneous bandwidth usage of the video data stream until the current remaining computing power is sufficient to support the increase in the complexity of the verification algorithm.
[0016] Secondly, a communication controller error detection system based on algorithm optimization, characterized in that the system is used to implement the steps of any of the methods described above, the system comprising: Acquisition module: Acquires real-time operating status parameters of the communication controller, including internal status parameters reflecting the internal processing resource occupancy, and external environmental parameters reflecting the characteristics of external interference sources and the quality of the physical channel; Determination module: Based on the correlation analysis of the internal state parameters and the external environment parameters, determine the risk assessment value corresponding to the target control data packet; Error detection strategy adjustment module: Based on the risk assessment value, dynamically adjust the error detection strategy for the target control data packet. The adjustment of the error detection strategy includes adjusting the detection sensitivity threshold, switching the complexity of the verification algorithm, or enabling or disabling the error correction function. Specifically, when the risk assessment value crosses the strategy switching threshold multiple times within a preset time window and the fluctuation frequency exceeds a preset frequency threshold, the system enters a strategy locking state, stops switching strategies based on instantaneous changes, calculates the arithmetic mean of the risk assessment value within the time window, determines the target detection strategy based on the arithmetic mean, and after the time window ends, adjusts the current strategy to the target detection strategy all at once, and then exits the strategy locking state.
[0017] Beneficial Effects: This application proposes an algorithm-optimized error detection method and system for communication controllers. By acquiring real-time operating status parameters of the communication controller, including internal status parameters and external environmental parameters, and performing correlation analysis based on these parameters, the risk assessment value of the target control data packet is determined. Then, the error detection strategy is dynamically adjusted according to the risk assessment value, including adjusting the detection sensitivity threshold, switching the complexity of the verification algorithm, or enabling / disabling error correction functions. Furthermore, when the risk assessment value fluctuates drastically, a strategy locking state is entered, the average value is calculated, and the strategy is adjusted all at once. Therefore, this application has the advantage of being able to adaptively adjust the detection strategy and optimize verification parameters according to real-time communication conditions, thereby improving error identification efficiency. Attached Figure Description
[0018] Figure 1 This is a flowchart of a communication controller error detection method based on algorithm optimization proposed in this application.
[0019] Figure 2 This is a structural diagram of a communication controller error detection system based on algorithm optimization proposed in this application.
[0020] Figure 3 This is a schematic diagram of a communication controller error detection system based on algorithm optimization proposed in this application.
[0021] Labeling Explanation: 201, Acquisition Module; 202, Determination Module; 203, Error Detection Strategy Adjustment Module. Detailed Implementation
[0022] 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 a part of the embodiments of this application, and not all of them. The components of the embodiments of this application described and marked in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0023] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this application, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0024] Please refer to Figure 1 This application provides an algorithm-optimized error detection method for communication controllers, the method comprising the following steps: S1: Obtain the real-time operating status parameters of the communication controller. The real-time operating status parameters include internal status parameters reflecting the internal processing resource usage, and external environmental parameters reflecting the characteristics of external interference sources and the quality of the physical channel. S2: Based on the correlation analysis of internal state parameters and external environment parameters, determine the risk assessment value corresponding to the target control data packet; S3: Based on the risk assessment value, dynamically adjust the error detection strategy for the target control data packet. The adjustment of the error detection strategy includes adjusting the detection sensitivity threshold, switching the complexity of the verification algorithm, or enabling or disabling the error correction function. Specifically, when the risk assessment value crosses the strategy switching threshold multiple times within a preset time window and the fluctuation frequency exceeds the preset frequency threshold, the system enters a strategy locking state, stops switching strategies based on instantaneous changes, calculates the arithmetic mean of the risk assessment values within the time window, determines the target detection strategy based on the arithmetic mean, and then adjusts the current strategy to the target detection strategy once after the time window ends, before exiting the strategy locking state.
[0025] This application dynamically acquires the real-time operating status parameters of the communication controller and performs correlation analysis based on these parameters to determine the risk assessment value. It then dynamically adjusts the error detection strategy, thereby effectively addressing the problem of high false negative rates in traditional fixed verification mechanisms under complex industrial communication environments and significantly improving data integrity and system security.
[0026] Internal status parameters can be obtained by reading the internal registers of the communication controller or through specific diagnostic interfaces. Specifically, the memory management unit can be periodically queried to obtain the current free and allocated space of the memory buffer, thereby calculating the memory occupancy rate. Alternatively, the task scheduler status of the main processing chip can be read to obtain the runtime slice allocation of different tasks, thus calculating the load on the main processing chip. External environmental parameters can be obtained through sensors integrated into the communication module or dedicated monitoring circuits. For example, a spectrum analyzer or signal strength meter can be used to monitor the signal strength and noise level on the communication cable in real time, thereby assessing the instantaneous signal-to-noise ratio of the communication cable. Furthermore, the characteristics of the received video data stream can be evaluated by analyzing its metadata, such as frame type and bitrate.
[0027] The purpose of correlation analysis is to integrate internal state parameters and external environmental parameters from different sources and with different dimensions to form a unified risk indicator. For example, rule-based reasoning mechanisms can be used for correlation analysis. Specifically, a series of rules can be preset, such as "if memory utilization exceeds 80% and the signal-to-noise ratio is below 15dB, the risk assessment value increases by 0.3". Then, a weighted summation method is used to assign a fixed weight to each parameter, and the weighted parameter values are summed to obtain a preliminary risk index. This index is then normalized to fall between 0 and 1, thus obtaining the risk assessment value.
[0028] Adjustments to error detection strategies include adjusting the detection sensitivity threshold, switching the complexity of the verification algorithm, or enabling / disabling error correction functions. For example, when the risk assessment value is low, a high detection sensitivity threshold can be maintained, and packets are only marked as abnormal when a clear error is detected (such as a CRC check failure). When the risk assessment value is moderate, the detection sensitivity threshold can be lowered so that even slight signal distortions or potential error patterns can be identified, triggering a second check. When the risk assessment value is high, the detection sensitivity threshold can be further lowered, and a more complex verification algorithm can be switched to, such as adding additional check codes, or enabling error correction functions, such as duplicate code transmission, to maximize data integrity.
[0029] In a specific implementation scenario, to prevent frequent and rapid fluctuations in risk assessment values around the policy switching threshold under certain special conditions, such as rapid switching of video content between bright and dark scenes, which could lead to excessive switching of error detection policies, consuming unnecessary computing resources, or introducing system instability, this method also includes a policy locking mechanism. When the risk assessment value is detected to have crossed a certain policy switching threshold multiple times within a preset time window, such as 100 milliseconds, and its fluctuation frequency exceeds a preset frequency threshold, such as 10 times per second, a policy locking state will be entered.
[0030] In strategy-locked mode, strategy switching based on every instantaneous change in risk assessment value will be paused. Instead, risk assessment values will be continuously collected over a preset time window, and the arithmetic mean of all collected risk assessment values will be calculated. This arithmetic mean effectively smooths out sudden, drastic fluctuations, reflecting a more stable and representative risk trend over that period. After the preset time window ends, a final target detection strategy will be determined based on this calculated arithmetic mean, and the current strategy will be adjusted to this target detection strategy in one go. After this adjustment, strategy-locked mode will be exited, and the system will revert to the normal mode of dynamic adjustment based on real-time risk assessment values.
[0031] The logic for determining the strategy lock-in status involves real-time monitoring of the fluctuation frequency of risk assessment values. Within a preset time window, a counter increments whenever the risk assessment value crosses a preset strategy switching threshold. If the counter value exceeds the frequency threshold before the window ends, the current environment is determined to be in a state of extremely unstable transient fluctuations. At this point, frequent strategy jumps are stopped, and a smoothing filtering mechanism is activated instead. By calculating the arithmetic mean of all sampling points within the window, the steady-state component of the environmental risk is extracted, allowing for a one-time compensatory adjustment after the window ends, effectively avoiding wasted computational overhead caused by frequent strategy oscillations.
[0032] The above technical solutions enable real-time perception and dynamic adaptation to transient, data-dependent errors and timing uncertainties caused by video stream interference and memory congestion, effectively reducing the missed detection rate of critical control commands and thus ensuring production safety and product quality.
[0033] Furthermore, internal state parameters include memory buffer state and main processing chip load, while external environment parameters include video data stream characteristics and communication cable signal quality.
[0034] The internal state parameters are specified as memory buffer state and main processing chip load because these two indicators directly reflect the core constraints on the internal processing resources of the communication controller.
[0035] The memory buffer is a temporary storage area for data packets to be processed, and its state is directly related to the queuing delay and timing jitter of data processing. The main processing chip is the core unit that performs all data processing and verification calculations, and its load determines the timeliness of processing instructions.
[0036] Similarly, specifying external environmental parameters as video data stream characteristics and communication cable signal quality is because these two indicators are the main sources of external interference and physical layer errors. The characteristics of video data streams, especially the dynamic nature of their images, directly determine the intensity of high-frequency energy components in their signal spectrum, which is the physical basis for signal crosstalk. The signal quality of communication cables, on the other hand, is the ultimate reflection of the reliability of data transmission in the physical medium, and is the combined result of all interference factors. Precise monitoring of these four key parameters provides a solid and direct data foundation for subsequent risk assessment.
[0037] Furthermore, step S1 includes: S11: Obtain the size of the free space and the size of the allocated space in the memory buffer, calculate the memory usage rate, and obtain the memory buffer status; S12: Read the idle task time slice counter of the main processing chip and calculate the load of the main processing chip; S13: By comparing the total pixel differences of consecutive video frames, or by detecting the changes in the ratio of I-frames, P-frames, and B-frames output by the video encoder, the dynamics of the video data stream are evaluated to obtain the characteristics of the video data stream. S14: Obtain the instantaneous signal-to-noise ratio of the communication cable to obtain the signal quality of the communication cable.
[0038] In the hardware architecture of a communication controller, a memory management unit is typically included, which manages data access in memory. By periodically reading the status register provided by this memory management unit, the total size of the memory buffer used to store communication data to be processed, the allocated space size, and the remaining free space size can be obtained in real time. For example, in a 1MB FIFO queue buffer, if the status register shows that 800KB of data has been written, the memory occupancy rate can be calculated as 80%. This percentage value intuitively quantifies the congestion level of the buffer.
[0039] Secondly, the real-time operating system on the communication controller typically has a lowest-priority idle task. When no other higher-priority tasks, such as video data processing or control command verification, need to run, the main processing chip executes this idle task. The load on the main processing chip can be calculated by reading a counter that accumulates the idle task's execution time at fixed time intervals, such as every 10ms. For example, if the idle task time slice counter increases by 2ms within a 10ms statistical period, it means that the main processing chip has spent 8ms processing other effective tasks, and its load is 80%.
[0040] Secondly, a lightweight video frame analysis module can be deployed at the data link layer of the communication controller. This module compares the brightness or color values of each pixel in two consecutively received video frames and sums the differences between all pixels to obtain a total pixel difference. If this total exceeds a preset threshold, the current scene is considered to be in a high dynamic range. For example, when the scene switches from a close-up of a static device to a high-speed conveyor belt, the total pixel difference will increase significantly.
[0041] In another embodiment, the data stream structure output by the video encoder can be analyzed. In common video coding standards such as H.264, video frames are divided into I-frames, P-frames, and B-frames. An I-frame is a complete image frame, while P-frames and B-frames are predicted frames based on the differences between consecutive frames. When the content of the scene changes drastically, the encoder generates more I-frames to ensure image quality. Therefore, by statistically analyzing the proportion of I-frames among all frame types per unit time, the dynamics of the scene can be effectively assessed. An increased proportion of I-frames usually indicates an increase in the high-frequency energy components of the video signal, and the risk of crosstalk also increases accordingly.
[0042] Finally, a digital signal processing module is typically integrated into the physical layer transceiver chip that connects the communication controller to the physical cable. This module continuously measures and compares the signal strength with the background noise level when receiving signals, and provides a real-time instantaneous signal-to-noise ratio (SNR) reading through its internal registers. This value directly reflects the health of the physical channel. When crosstalk in the video signal increases, it manifests as an increase in the background noise level of the control signal channel, leading to a decrease in the instantaneous SNR.
[0043] Furthermore, step S2 includes: S21: When the memory usage exceeds the preset usage threshold and the screen dynamics are at the preset high dynamic level, increase the weight coefficient of screen dynamics and decrease other weight coefficients; when the instantaneous signal-to-noise ratio is lower than the preset signal-to-noise ratio threshold, increase the weight coefficient of the normalized instantaneous signal-to-noise ratio and decrease other weight coefficients. S22: Calculate the risk index using the weighted summation formula based on the adjusted weighting coefficients: Risk Index = W_buffer × memory occupancy rate + W_dynamic × screen dynamics + W_cpu × main processing chip load + W_snr × (1 - normalized instantaneous signal-to-noise ratio), where W_buffer is the weighting coefficient assigned to memory occupancy rate, W_dynamic is the weighting coefficient assigned to screen dynamics, W_cpu is the weighting coefficient assigned to main processing chip load, and W_snr is the weighting coefficient assigned to normalized instantaneous signal-to-noise ratio, and W_buffer + W_dynamic + W_cpu + W_snr = 1; S23: Normalize the risk index to obtain a risk assessment value ranging from 0 to 1.
[0044] Since the importance of different risk factors varies under different operating conditions, it is necessary to dynamically adjust the weighting coefficients of each parameter. For example, a series of conditional rules can be set. When the memory usage rate exceeds a preset threshold, such as 80%, and the assessed image dynamism is also at a preset high dynamism level, it means that the two risk factors, memory congestion and signal crosstalk, may have a cumulative effect, and the harm of signal crosstalk will be more prominent. Therefore, under this specific condition, the weighting coefficient assigned to image dynamism will be increased, for example, from the initial 0.3 to 0.5, while the weighting coefficients of other parameters will be reduced proportionally to ensure that the sum of all weighting coefficients remains 1.
[0045] Similarly, when the instantaneous signal-to-noise ratio (SNR) of the communication cable is detected to be lower than a preset SNR threshold, such as 15 dB, it indicates that the degradation of the physical channel quality has become the primary source of risk. In this case, the weighting factor assigned to the normalized instantaneous SNR will be significantly increased, for example, from the initial 0.2 to 0.4, while other weighting factors will be decreased accordingly.
[0046] The concrete logic of correlation analysis lies in establishing coupled mapping relationships between multi-dimensional parameters. When memory utilization is high and the dynamics of the video feed are enhanced, this overlap is not a simple numerical accumulation, but rather signifies that the communication controller is facing the dual pressures of internal processing latency and increased external interference. The correlation analysis process determines the gain coefficient of the risk index by constructing a two-dimensional or multi-dimensional lookup table matrix. This means that within a specific load range, the contribution of fluctuations in video stream characteristics to risk exhibits a non-linear growth. This logic can capture the non-additive interference effects generated by high-frequency video signals in congested physical channels, thus more accurately reflecting the survivability of control commands under specific physical and logical environments.
[0047] Next, based on the adjusted weighting coefficients, an initial risk index is calculated using a weighted summation formula. This formula can be expressed as: Risk Index = W_buffer × Memory Usage + W_dynamic × Screen Dynamics + W_cpu × Main Processing Chip Load + W_snr × (1 - Normalized Instantaneous Signal-to-Noise Ratio). In this formula, W_buffer, W_dynamic, W_cpu, and W_snr are dynamically adjusted weighting coefficients assigned to memory usage, screen dynamics, main processing chip load, and normalized instantaneous signal-to-noise ratio, respectively. All input parameters, such as memory usage and screen dynamics, are pre-processed to ensure their values are between 0 and 1. Specifically, the instantaneous signal-to-noise ratio is expressed as (1 - normalized instantaneous signal-to-noise ratio) to ensure that a lower signal-to-noise ratio, i.e., a worse signal quality, contributes more to the risk index, which aligns with the intuitive logic of risk assessment.
[0048] Finally, the risk index calculated using the weighted summation formula is normalized to ensure that the final risk assessment value strictly falls within the range of 0 to 1. This normalized risk assessment value will serve as a unified, standardized metric to guide the dynamic adjustment of all subsequent error detection strategies. A value close to 1 indicates that the current target control data packet faces an extremely high risk of error, while a value close to 0 indicates a good communication environment and low risk.
[0049] The normalization of risk assessment values employs a min-max mapping algorithm to limit the weighted results to a value between zero and one. For the instantaneous signal-to-noise ratio (SNR) parameter, the calculation involves subtracting the normalized SNR value from 1, ensuring that a higher risk component corresponds to lower signal quality, consistent with the intuitive logic that risk increases with environmental deterioration. All state parameters undergo standardization preprocessing before weighted calculation to eliminate the dimensional influence of different physical units, ensuring that the risk assessment value serves as a purely probabilistic indicator to guide strategy adjustments.
[0050] Furthermore, in step S3, adjusting the detection sensitivity threshold includes the following steps: S31: When the risk assessment value is less than the first risk threshold, the detection sensitivity threshold is set to the first sensitivity value. Under this setting, the target control data packet is marked as abnormal only when the cyclic redundancy check report is incorrect. S32: When the risk assessment value is between the first risk threshold and the second risk threshold, the detection sensitivity threshold is reduced to the second sensitivity value. Under this setting, if the cyclic redundancy check result is passed and the physical layer detects signal distortion, the target control data packet is marked as suspicious and a second review is triggered; wherein, the second sensitivity value is less than the first sensitivity value.
[0051] In one specific implementation, when the calculated risk assessment value is less than a preset first risk threshold, such as 0.3, it indicates that the current communication environment is relatively stable and the probability of complex error modes occurring is low. Under this low-risk state, the detection sensitivity threshold is set to a conventional first sensitivity value. With this setting, the error detection logic is relatively simplified and efficient. Only when the checksum calculated by the standard cyclic redundancy check algorithm does not match the checksum carried in the data packet (i.e., when the cyclic redundancy check reports an error) is the target control data packet marked as an abnormal data packet, and subsequent error handling procedures, such as discarding or requesting retransmission, initiated.
[0052] When the risk assessment value increases, falling between the first and second risk thresholds (e.g., between 0.3 and 0.6), it indicates an increased risk in the communication environment. Traditional cyclic redundancy check (CR) may miss detections, especially for minor signal distortions caused by signal crosstalk. In this case, increased vigilance is needed, dynamically lowering the detection sensitivity threshold to a more stringent second sensitivity value, which is lower than the first sensitivity value. Under this setting, the error detection logic becomes more rigorous. If a target control packet passes the CR, but the physical layer transceiver detects transient signal distortion, such as eye diagram closure or excessive jitter parameters in the received signal, the packet will not be directly considered normal, even if the checksum matches. Instead, it will be marked as a suspicious packet, triggering a secondary verification mechanism.
[0053] Secondary verification can include more complex check algorithms or logical consistency comparisons with preceding and following data packets. This tiered sensitivity adjustment ensures that potential errors that might be missed by routine checks can be detected when risks increase. Specifically, secondary verification involves initiating additional logical consistency checks on data packets that have already passed routine checks when signal distortion is detected at the physical layer. This verification not only re-runs higher-order check calculations but also performs time-related judgments based on the historical sequence of the control command. For example, if the current command's jump amplitude far exceeds the physical limits of the industrial process, even if the check result is correct, it will be marked as suspicious due to abnormal signal quality and handed over to a higher-level logic processing unit for decision-making. This multi-layered verification mechanism greatly enhances the ability to intercept missed errors in complex interference environments.
[0054] Furthermore, in step S3, switching the complexity of the verification algorithm or enabling / disabling the error correction function includes the following steps: S33: When the risk assessment value is greater than the second risk threshold and less than the third risk threshold, perform the first level of enhanced verification: calculate an additional verification code in addition to the standard verification code; S34: When the risk assessment value is between the third and fourth risk thresholds, perform the second level of enhanced verification: On the basis of the first level of enhanced verification, a verification polynomial is used for the key control parameters, and the error correction function is temporarily not enabled. S35: When the risk assessment value is greater than the fourth risk threshold, execute the error correction function: send the same key data twice using a duplicate code for the key control parameters.
[0055] In one specific implementation, when the risk assessment value is greater than the second risk threshold and less than the third risk threshold, for example, between 0.6 and 0.8, it indicates a high risk in the communication environment, requiring the execution of Level 1 enhanced verification. In this case, in addition to calculating the standard checksum, such as CRC-16, one or more additional checksums are calculated. For example, a more robust CRC-32 checksum can be calculated, or simple parity check bits can be added to some non-critical payload portions of the data packet. Only when all these checksums pass are the data packet considered valid.
[0056] When the risk assessment value falls between the third and fourth risk thresholds, for example, between 0.8 and 0.9, it indicates that the communication environment is quite severe, requiring a second-level enhanced verification. Building upon the first-level enhanced verification, a specially selected verification polynomial, more sensitive to short burst errors, is used to perform cyclic redundancy check calculations for key control parameters in the target control data packet, such as the target coordinates of the robotic arm or the motor's speed setting. Different verification polynomials have different detection capabilities for different types of error modes. Selecting a polynomial optimized for the current primary risk—short burst errors caused by video signal crosstalk—can significantly improve detection accuracy. At this stage, to ensure real-time processing, computationally expensive error correction functions are typically not enabled.
[0057] When the risk assessment value exceeds the fourth risk threshold, for example, 0.9, it indicates that the communication environment has entered an extremely high-risk state, at which point data reliability becomes the primary objective. In this case, error correction will be implemented. A simple and effective implementation method is to use a repetition code strategy for critical control parameters. That is, at the transmitting end, the same critical data, such as a 16-bit setting value, is transmitted twice consecutively. After receiving the data, the receiving end compares the two copies. If they are completely identical, the data is considered correct; if there is a discrepancy, and it can be determined to be a single-bit error, error correction can be performed; if the difference is too large, it is determined to be an unrecoverable error. Although this method sacrifices some transmission efficiency, it provides an extra layer of protection for the correct recovery of critical data in extremely harsh environments.
[0058] After performing the above error correction function, to handle the most extreme cases, this method may also include further proactive intervention measures. Following step S35, the method further includes: S36: Set a high-risk intervention threshold, which is greater than the fourth risk threshold; S37: When the risk assessment value is greater than or equal to the high-risk intervention threshold, take proactive intervention action.
[0059] In one specific implementation, a high-risk intervention threshold is first set, which is greater than a fourth risk threshold, for example, set to 0.95. When the risk assessment value is greater than or equal to this high-risk intervention threshold, it indicates that the communication environment is extremely dangerous, and simple passive detection and error correction may not be sufficient to ensure the absolute security of the system. At this time, a series of active intervention actions will be executed.
[0060] Furthermore, in step S37, performing the active intervention includes the following steps: S371: Send a data integrity risk warning to the main control system via an interrupt signal or status register, and record the risk assessment value in the system log; S372: Send a retransmission request frame to the sender before the target control data packet is fully processed; S373: When processing target control packets, the processing task of the target control packets is elevated to the highest priority by modifying the priority parameter in the task scheduler.
[0061] In some specific implementations, proactive intervention actions include: First, a clear data integrity risk warning is sent to the main control system, such as the central controller of the robotic arm, via a dedicated hardware interrupt signal or by writing a warning flag to a specific status register. Upon receiving this warning, the main control system can immediately take preventative measures, such as slowing down the robotic arm's movement speed or pausing all actions before receiving the next instruction, waiting for the communication controller to confirm data reliability. Simultaneously, the current risk assessment value and the original state parameters leading to this high risk are recorded in detail in the communication controller's system log, providing a basis for subsequent troubleshooting and system optimization.
[0062] Second, before the target control data packet is fully processed and verified, a retransmission request frame with a specific identifier is proactively sent to the sender. This preemptive retransmission request, without waiting for the verification result, greatly shortens the time delay between detecting a high risk and obtaining a reliable data copy.
[0063] Third, when processing this high-risk target control data packet, the priority parameters in the task scheduler of the real-time operating system inside the communication controller are dynamically modified, instantly elevating the task responsible for processing the packet from its normal priority to the highest priority in the system. This means that even if the main processing chip is currently busy processing massive video data frames, it will immediately interrupt its current task and allocate all computing resources to the verification and processing of this critical control data packet, thereby minimizing processing delays and timing uncertainties caused by internal resource contention.
[0064] Furthermore, step S33 includes the following steps: S331: When the risk assessment value is greater than the second risk threshold and less than the third risk threshold, obtain the current remaining computing power of the communication controller; S332: Predict the expected computing power cost after performing the first-level enhanced verification. If the expected computing power cost is greater than the current remaining computing power, maintain the current verification algorithm complexity. S333: Send a speed-down command to the source of the video data stream to reduce the instantaneous bandwidth usage of the video data stream until the remaining computing power is sufficient to support the increase in the complexity of the verification algorithm.
[0065] The remaining computing power can be obtained by querying the performance counters of the main processing chip or the task load statistics of the real-time operating system.
[0066] Next, based on the pre-evaluated algorithm model, the expected computational cost required to perform the first level of enhanced verification, such as calculating an additional CRC-32 checksum, is predicted. This expected computational cost is then compared to the currently available remaining computational power. If the expected computational cost exceeds the available remaining computational power, it means that forcibly increasing the verification complexity may lead to insufficient processing capacity, negatively impacting overall real-time performance. In this case, the current verification algorithm complexity will be temporarily maintained, and enhanced verification will not be performed.
[0067] The pre-evaluated algorithm model is based on the product of the time complexity model of the verification algorithm and the length of the current data packet to be processed. The communication controller pre-stores a table of processor cycle consumption for different verification algorithms per unit data volume. When a policy upgrade request is triggered, the scheduler calculates the total number of cycles required by the target algorithm and compares it with the idle time slices in the current task queue. This feedforward predictive logic ensures that the increase in algorithm complexity is within the hardware's capacity, preventing controller overload collapse or loss of real-time performance due to blindly pursuing detection intensity.
[0068] To address the issue of insufficient computing power, rather than simply abandoning enhanced verification, a proactive resource coordination measure is employed. A rate-reduction command is sent to the source of the video data stream, such as a webcam or video server. This command can request the source to temporarily reduce the frame rate, resolution, or increase the compression ratio of the video stream, thereby reducing the instantaneous bandwidth consumption of the video data stream. As the load of the video data processing task decreases, the remaining computing power of the communication controller's main processing chip increases accordingly. This process continues until it is detected that the current remaining computing power is sufficient to support the expected computing power expenditure required for the first-level enhanced verification. At this point, the verification algorithm complexity is officially increased to the level of the first-level enhanced verification. This intelligent resource management and coordination mechanism ensures that while improving data integrity assurance capabilities, stability and real-time performance are also taken into account.
[0069] Please refer to Figure 2 , Figure 3 A communication controller error detection system based on algorithm optimization, characterized in that the system implements the steps of any of the above methods, and the system includes: Acquisition module 201: Acquires the real-time operating status parameters of the communication controller. The real-time operating status parameters include internal status parameters reflecting the internal processing resource usage, and external environmental parameters reflecting the characteristics of external interference sources and the quality of the physical channel. Module 202: Based on the correlation analysis of internal state parameters and external environment parameters, determine the risk assessment value corresponding to the target control data packet; Error detection strategy adjustment module 203: Based on the risk assessment value, dynamically adjust the error detection strategy for the target control data packet. The adjustment of the error detection strategy includes adjusting the detection sensitivity threshold, switching the complexity of the verification algorithm, or enabling or disabling the error correction function. Specifically, when the risk assessment value crosses the strategy switching threshold multiple times within a preset time window and the fluctuation frequency exceeds the preset frequency threshold, the system enters a strategy locking state, stops switching strategies based on instantaneous changes, calculates the arithmetic mean of the risk assessment values within the time window, determines the target detection strategy based on the arithmetic mean, and then adjusts the current strategy to the target detection strategy once after the time window ends, before exiting the strategy locking state.
[0070] Specifically, in the field of industrial automation, communication controllers face complex error modes during data transmission caused by the multiplexing of high-bandwidth real-time video streams and control commands using the same communication resources. Traditional fixed cyclic redundancy check (CRC) mechanisms cannot effectively handle context-dependent and intermittent errors caused by timing jitter and dynamic crosstalk, leading to a significant increase in the false negative rate. This application introduces an acquisition module 201 to achieve comprehensive perception of the communication controller's internal processing resource usage, external interference source characteristics, and physical channel quality. The dynamic acquisition of these parameters enables the system to monitor changes in the communication environment in real time, laying the foundation for subsequent risk assessment.
[0071] Subsequently, by determining the correlation analysis between internal state parameters and external environment parameters based on module 202, this application can determine the risk assessment value corresponding to the target control data packet. For example, when the memory buffer occupancy rate is high, the main processing chip load is large, the video data stream is highly dynamic, and the signal-to-noise ratio of the communication cable is low, the system can identify that the current communication environment is in a high-risk state, thereby obtaining a higher risk assessment value.
[0072] Ultimately, based on the determined risk assessment value, this application can dynamically adjust the error detection strategy for the target control data packet through the error detection strategy adjustment module 203. This dynamic adjustment includes adjusting the detection sensitivity threshold, switching the complexity of the verification algorithm, or enabling / disabling error correction functions. For example, in a low-risk environment, the system can use a lower detection sensitivity and a simpler verification algorithm to reduce system overhead; while in a high-risk environment, the system can increase the detection sensitivity, switch to a more complex verification algorithm, or even enable error correction functions to maximize data integrity. Furthermore, the introduction of a strategy locking mechanism effectively avoids frequent strategy switching when the risk assessment value fluctuates frequently, ensuring the stability of the system during the dynamic adjustment process.
[0073] Compared with the fixed cyclic redundancy check (CRC) mechanism used in existing technologies, the communication controller error detection system proposed in this application has the advantage of its adaptability and dynamic optimization capability. Traditional fixed CRC check algorithms cannot adjust their detection strategies according to changes in real-time communication conditions, resulting in a significant increase in the false negative rate in complex and ever-changing industrial communication environments, especially in the face of occasional, short-term consecutive bit flip errors caused by timing jitter and dynamic crosstalk.
[0074] The system of this application uses an acquisition module 201 to perceive the internal state parameters and external environmental parameters of the communication controller in real time, and a determination module 202 to perform correlation analysis to quantify risks. Then, an error detection strategy adjustment module 203 dynamically adjusts the error detection strategy. This systematic design makes error detection no longer static and passive, but allows for flexible adjustment of detection sensitivity, verification algorithm complexity, and error correction functions based on the actual communication environment and system load. For example, when the system detects memory buffer congestion or a decrease in the signal-to-noise ratio of the communication cable, the acquisition module 201 can promptly capture this information, the determination module 202 can accurately assess the risk, and the error detection strategy adjustment module 203 can immediately increase detection sensitivity, switch to a more powerful verification algorithm, or even enable error correction functions. This allows for effective intervention before or in the early stages of an error, preventing damage to data integrity. Furthermore, the introduction of a strategy locking mechanism further enhances the system's robustness, avoids frequent strategy switching due to instantaneous fluctuations, and ensures the stability of system operation.
[0075] Therefore, the system proposed in this application can effectively solve the problem of high false negative rate of traditional fixed verification mechanism in complex industrial communication environment, significantly improve data integrity and system security, and meet the strict requirements of high-value product quality and personal safety for data integrity.
[0076] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A communication controller error detection method based on algorithm optimization, characterized in that, The method includes the following steps: S1: Obtain the real-time operating status parameters of the communication controller. The real-time operating status parameters include internal status parameters reflecting the internal processing resource occupancy and external environmental parameters reflecting the characteristics of external interference sources and the quality of the physical channel. S2: Based on the internal state parameters and the external environment parameters, perform correlation analysis to determine the risk assessment value corresponding to the target control data packet; S3: Based on the risk assessment value, dynamically adjust the error detection strategy for the target control data packet. The adjustment of the error detection strategy includes adjusting the detection sensitivity threshold, switching the complexity of the verification algorithm, or enabling or disabling the error correction function. Specifically, when the risk assessment value crosses the strategy switching threshold multiple times within a preset time window and the fluctuation frequency exceeds a preset frequency threshold, the system enters a strategy locking state, stops switching strategies based on instantaneous changes, calculates the arithmetic mean of the risk assessment value within the time window, determines the target detection strategy based on the arithmetic mean, and after the time window ends, adjusts the current strategy to the target detection strategy all at once, and then exits the strategy locking state.
2. The communication controller error detection method based on algorithm optimization according to claim 1, characterized in that, The internal state parameters include the memory buffer state and the main processing chip load, while the external environment parameters include the video data stream characteristics and the communication cable signal quality.
3. The communication controller error detection method based on algorithm optimization according to claim 2, characterized in that, Step S1 includes: S11: Obtain the free space size and allocated space size of the memory buffer, calculate the memory occupancy rate, and obtain the memory buffer status; S12: Read the idle task time slice counter of the main processing chip and calculate the load of the main processing chip; S13: By comparing the sum of pixel differences in consecutive video frames, or by detecting the changes in the ratio of I-frames, P-frames, and B-frames output by the video encoder, the dynamics of the video data stream are evaluated to obtain the characteristics of the video data stream. S14: Obtain the instantaneous signal-to-noise ratio of the communication cable to obtain the signal quality of the communication cable.
4. The communication controller error detection method based on algorithm optimization according to claim 3, characterized in that, Step S2 includes: S21: When the memory occupancy rate exceeds a preset occupancy threshold and the screen dynamics are at a preset high dynamic level, increase the weight coefficient of the screen dynamics and decrease other weight coefficients; when the instantaneous signal-to-noise ratio is lower than a preset signal-to-noise ratio threshold, increase the weight coefficient of the normalized instantaneous signal-to-noise ratio and decrease other weight coefficients. S22: Calculate the risk index using the weighted summation formula based on the adjusted weighting coefficients: Risk Index = W_buffer × memory occupancy rate + W_dynamic × screen dynamics + W_cpu × main processing chip load + W_snr × (1 - normalized instantaneous signal-to-noise ratio), where W_buffer is the weighting coefficient assigned to memory occupancy rate, W_dynamic is the weighting coefficient assigned to screen dynamics, W_cpu is the weighting coefficient assigned to main processing chip load, and W_snr is the weighting coefficient assigned to the normalized instantaneous signal-to-noise ratio, and W_buffer + W_dynamic + W_cpu + W_snr = 1; S23: Normalize the risk index to obtain the risk assessment value ranging from 0 to 1.
5. The communication controller error detection method based on algorithm optimization according to claim 1, characterized in that, In step S3, adjusting the detection sensitivity threshold includes the following steps: S31: When the risk assessment value is less than the first risk threshold, the detection sensitivity threshold is set to the first sensitivity value. Under this setting, the target control data packet is marked as abnormal only when the cyclic redundancy check report is incorrect. S32: When the risk assessment value is between the first risk threshold and the second risk threshold, the detection sensitivity threshold is reduced to the second sensitivity value. Under this setting, if the cyclic redundancy check result is passed and the physical layer detects signal distortion, the target control data packet is marked as suspicious and a second review is triggered; wherein, the second sensitivity value is less than the first sensitivity value.
6. The communication controller error detection method based on algorithm optimization according to claim 1, characterized in that, In step S3, switching the complexity of the verification algorithm or enabling / disabling the error correction function includes the following steps: S33: When the risk assessment value is greater than the second risk threshold and less than the third risk threshold, perform the first level of enhanced verification: calculate an additional verification code in addition to the standard verification code; S34: When the risk assessment value is between the third risk threshold and the fourth risk threshold, perform the second level of enhanced verification: On the basis of the first level of enhanced verification, a verification polynomial is used for the key control parameters, and the error correction function is temporarily not enabled. S35: When the risk assessment value is greater than the fourth risk threshold, execute the error correction function: send the same key data twice using a duplicate code for the key control parameters.
7. The communication controller error detection method based on algorithm optimization according to claim 6, characterized in that, After step S35, the method further includes: S36: Set a high-risk intervention threshold, wherein the high-risk intervention threshold is greater than the fourth risk threshold; S37: When the risk assessment value is greater than or equal to the high-risk intervention threshold, an active intervention action is performed.
8. The communication controller error detection method based on algorithm optimization according to claim 7, characterized in that, In step S37, performing the active intervention includes the following steps: S371: Send a data integrity risk warning to the main control system via an interrupt signal or status register, and record the risk assessment value in the system log; S372: Before the target control data packet is completely processed, a retransmission request frame is sent to the sending end; S373: When processing the target control data packet, the processing task of the target control data packet is promoted to the highest priority by modifying the priority parameter in the task scheduler.
9. The communication controller error detection method based on algorithm optimization according to claim 6, characterized in that, Step S33 includes the following steps: S331: When the risk assessment value is greater than the second risk threshold and less than the third risk threshold, obtain the current remaining computing power of the communication controller; S332: Predict the expected computing power cost after performing the first-level enhanced verification. If the expected computing power cost is greater than the current remaining computing power, maintain the current verification algorithm complexity. S333: Send a speed-down command to the source of the video data stream to reduce the instantaneous bandwidth usage of the video data stream until the current remaining computing power is sufficient to support the increase in the complexity of the verification algorithm.
10. A communication controller error detection system based on algorithm optimization, characterized in that, The system is used to implement the steps of the method according to any one of claims 1-9, and the system includes: Acquisition module: Acquires real-time operating status parameters of the communication controller, including internal status parameters reflecting the internal processing resource occupancy, and external environmental parameters reflecting the characteristics of external interference sources and the quality of the physical channel; Determination module: Based on the correlation analysis of the internal state parameters and the external environment parameters, determine the risk assessment value corresponding to the target control data packet; Error detection strategy adjustment module: Based on the risk assessment value, dynamically adjust the error detection strategy for the target control data packet. The adjustment of the error detection strategy includes adjusting the detection sensitivity threshold, switching the complexity of the verification algorithm, or enabling or disabling the error correction function. Specifically, when the risk assessment value crosses the strategy switching threshold multiple times within a preset time window and the fluctuation frequency exceeds a preset frequency threshold, the system enters a strategy locking state, stops switching strategies based on instantaneous changes, calculates the arithmetic mean of the risk assessment value within the time window, determines the target detection strategy based on the arithmetic mean, and after the time window ends, adjusts the current strategy to the target detection strategy all at once, and then exits the strategy locking state.