A data link optimization processing method
By real-time monitoring and dynamic adjustment of frame length and priority on the CAN bus of the automotive production line, the problem of data link instability caused by electromagnetic pulse interference was solved, and efficient data transmission in a strong interference environment was achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- JIANGXI SANGESHU INFORMATION TECH CO LTD
- Filing Date
- 2026-05-20
- Publication Date
- 2026-06-19
AI Technical Summary
In automobile manufacturing, the transmission stability of the data link is affected by electromagnetic pulse interference generated by the start-up and shutdown of high-power equipment, resulting in frame corruption and retransmission. Furthermore, traditional scheduling strategies are difficult to dynamically adapt to the time-varying characteristics of interference, leading to low bus efficiency and easy timeouts of real-time messages.
By monitoring the number of verification failures, frame waiting time, and power change rate of high-power devices on the CAN bus of the automotive production line in real time, the frame length and priority are dynamically adjusted, interference patterns are identified, and frame structure and scheduling strategies are optimized. The transmission priority is calculated by combining time pressure coefficient and urgency, thus achieving closed-loop adaptive adjustment.
It improves anti-interference capability, ensures that critical real-time frames obtain reasonable bandwidth under strong electromagnetic interference, reduces bus fragmentation, prevents message timeouts, and improves bus efficiency and real-time performance.
Smart Images

Figure CN122247562A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a data link optimization processing method. Background Technology
[0002] As the automotive manufacturing industry evolves towards higher-speed, more flexible operations, numerous automated equipment and sensors within workshops form real-time data links via industrial fieldbuses. The stability of this transmission directly determines collaborative efficiency and safety response capabilities. Electromagnetic pulses generated during the start-up and shutdown of high-power equipment severely interfere with bus signal integrity, leading to data frame corruption and retransmissions. Different commands exhibit vastly different timeliness, and low-priority messages are easily blocked for extended periods under high loads. Traditional methods relying on fixed frame lengths and static priorities struggle to dynamically adapt to the time-varying characteristics of interference. Furthermore, interference identification uses a single bit error rate threshold, lacking joint quantification of retransmissions and fragmentation in scheduling. Therefore, achieving adaptive interference pattern identification and joint optimization of frame structure and scheduling strategies has become a pressing technical challenge.
[0003] Chinese Patent Publication No. CN121301342A discloses a data link optimization method, apparatus, device, storage medium, and product. The method includes acquiring raw data containing data links, wherein the raw data includes various data tables, each data table having a corresponding data table granularity, and the data link includes the association relationships between the data tables, including row associations; based on the data table granularity and preset row association constraints, the row associations of each data table are simplified to obtain a simplified source table for each data table, wherein the association constraints include row data type association, and / or row data filtering, and / or row data aggregation, and the data link between the simplified source table and the corresponding data table has the shortest row association.
[0004] Therefore, the existing technology has the following problems: the method relies on the granularity of each data table to simplify row association, which easily overlooks implicit overriding relationships across granularities; the method relies on predefined row association constraints to construct transitive relationships, which is prone to failing to accurately capture row-level dependencies due to complex nested conditions in the actual processing logic; the method relies on comparing the total number of data and granularity to verify the validity of transitive relationships, which is prone to inaccurate comparison results due to statistical delays in large-scale links. Summary of the Invention
[0005] To address this, the present invention provides a data link optimization method that overcomes the problems of low bus efficiency and easy timeout of real-time messages caused by fixed parameters not adapting to dynamic interference and lack of coordination between retransmission and scheduling in the prior art by dynamically and jointly optimizing frame length and scheduling and dynamically correcting interference threshold.
[0006] To achieve the above objectives, the present invention provides a data link optimization processing method, comprising: The system acquires in real time the number of failed cyclic redundancy check (CR) checks on the CAN bus of the automotive production line, the waiting time and remaining valid time of each CAN data frame sent in the CAN controller's transmit buffer queue with preset frame length and preset priority weight, and the power change rate of high-power equipment, which are spot welding machines and stamping machines in the automotive production line. The interference intensity coefficient is determined based on the power change rate and the preset change threshold, and whether noise interference occurs is determined based on the threshold comparison result of the interference intensity coefficient. The interference mode is determined based on the number of verification failures and the interference intensity coefficient after noise interference occurs; The preset frame length is adjusted according to the interference mode and the number of verification failures to obtain the adjusted frame length, and the urgency of sending each message frame is determined according to the time pressure coefficient and the preset priority weight, wherein the time pressure coefficient is determined based on the waiting time and the remaining effective time. Based on the threshold comparison result of the sending urgency, several candidate upgrade frames are determined, and the upgrade duration increment is determined based on the number of candidate upgrade frames. The joint transmission duration is determined based on the number of verification failures and the upgrade duration increment, and the adjusted frame length or the candidate upgrade frame is iterated based on the joint transmission duration to obtain the iterated frame length and the target upgrade frame. Output the iteration frame length and the target upgrade frame; The preset change threshold is adjusted based on the switching frequency of the interference mode and the number of verification failures within the preset adjustment period.
[0007] Further, the process of determining the interference intensity coefficient based on the power change rate and the preset change threshold, and determining whether noise interference has occurred based on the threshold comparison result of the interference intensity coefficient, includes: The interference intensity coefficient is determined based on the ratio of the maximum power change rate to the preset change threshold. The occurrence of noise interference is determined based on the threshold comparison result of the interference intensity coefficient.
[0008] Furthermore, the process of determining the interference mode based on the number of verification failures and the interference intensity coefficient after noise interference occurs includes: The burst concentration is determined based on the historical average number of verification failures and the number of verification failures. The verification correlation coefficient is determined based on the autocorrelation characteristics of the number of verification failures, and the interference verification correlation degree is determined based on the interference intensity coefficient and the correlation characteristics of the number of verification failures. The interference fluctuation degree is determined based on the discrete characteristics of the interference intensity coefficient, and the interference duration factor is determined based on the interference fluctuation degree and the interference verification correlation. The interference mode is determined based on the threshold comparison results of the burst concentration, the interference verification correlation, and the interference persistence factor.
[0009] Further, the process of adjusting the preset frame length according to the interference mode and the number of verification failures to obtain the adjusted frame length includes: The preset frame length is adjusted based on the threshold comparison result between the interference mode and the average value of the verification failure to obtain the adjusted frame length.
[0010] Furthermore, the urgency of sending each message frame is determined based on the time pressure coefficient and the preset priority weight, wherein the process of determining the time pressure coefficient based on the already waited time and the remaining valid time includes: Obtain the CAN bus rate of the automotive production line CAN bus, and determine the single frame transmission time based on the adjusted frame length and CAN bus rate; The time pressure coefficient is determined based on the waiting time and the remaining effective time. The pressure correction factor is determined based on the single frame transmission time, and the correction pressure coefficient is determined based on the pressure correction factor and the time pressure coefficient. Based on the interference mode, the adjustment priority weight is determined according to the average verification failure, the preset priority weight, and the preset failure threshold, and the transmission urgency is determined according to the correction pressure coefficient and the adjustment priority weight.
[0011] Further, the process of determining several candidate upgrade frames based on the threshold comparison result of the transmission urgency, and determining the upgrade duration increment based on the number of candidate upgrade frames, includes: Based on the transmission urgency of the CAN data frame, a descending sequence of transmission urgency is determined, and the CAN data frame is sequentially determined as the candidate upgrade frame based on the threshold comparison results of the transmission urgency in the descending sequence of transmission urgency. The pre-calibrated extraction time of each CAN data frame is obtained, and the upgrade duration increment is determined based on the number of candidate upgrade frames and the pre-calibrated extraction time.
[0012] Further, the process of determining the joint transmission duration based on the number of verification failures and the upgrade duration increment, and iterating the adjusted frame length or the candidate upgrade frames based on the joint transmission duration to obtain the iterated frame length and the target upgrade frame includes: The pulse coverage probability is determined based on the number of verification failures, the expected single-frame latency is determined based on the pulse coverage probability and the adjusted frame length, and the joint transmission duration is determined based on the sum of the expected single-frame latency and the upgrade duration increment. The number of candidate upgrade frames is fixed, and the adjustment frame length that minimizes the joint transmission duration is selected as the iteration frame length by comparing the current adjustment frame length with the joint transmission duration after the adjustment of its adjacent step lengths. The length of the adjustment frame is fixed, and the candidate upgrade frame that minimizes the joint transmission time of the current candidate upgrade frame and its adjacent frames after adding or subtracting one frame is selected as the target upgrade frame.
[0013] Furthermore, the process of determining the pulse coverage probability based on the number of verification failures includes: The verification failure sequence is determined based on the number of verification failures at each moment within the preset time period; Several verification windows are determined based on the threshold comparison results of the number of verification failures in the verification failure sequence, and the average pulse width and average pulse interval are determined based on all the verification windows respectively. The pulse coverage probability is determined based on the average pulse width, the adjusted frame length, and the average pulse interval.
[0014] Further, the process of determining the expected single-frame latency based on the pulse coverage probability and the adjusted frame length, and determining the joint transmission duration based on the sum of the expected single-frame latency and the upgrade duration increment, includes: The expected time for a single frame is determined based on the pulse coverage probability and the adjusted frame length. The sum of the expected single-frame duration and the upgrade duration increment is calculated to obtain the joint transmission duration.
[0015] Furthermore, the process of adjusting the preset change threshold based on the switching frequency of the interference mode and the number of verification failures within the preset adjustment period includes: The switching deviation is determined based on the degree of deviation of the switching frequency of the interference mode within the preset adjustment period; The verification deviation is determined based on the average deviation of the number of verification failures, and a joint adjustment factor is determined based on the switching deviation and the verification deviation. Based on the signs of the joint adjustment factor, the switching deviation, and the verification deviation, the preset change threshold is adjusted according to a fixed step size.
[0016] Compared with existing technologies, the advantages of this invention are that by using the power change rate and a preset threshold to determine whether noise interference occurs, frequent optimization triggers due to environmental fluctuations are avoided. By combining the number of verification failures and the interference intensity coefficient to identify interference patterns, the targeting of anti-interference strategies is improved. For pulse-type interference, the frame length is dynamically adjusted and the transmission urgency is calculated based on the time pressure coefficient and the original priority, so that key real-time frames can still obtain reasonable bandwidth under strong electromagnetic interference. At the same time, candidate upgrade frames are screened by the urgency threshold and the upgrade duration increment is quantified to prevent blind upgrades from exacerbating bus fragmentation. By merging the pulse coverage probability and the upgrade duration increment into a joint transmission duration and iteratively optimizing the frame length and candidate upgrade frames, the total transmission time is minimized while ensuring real-time performance. The optimal frame length and target upgrade frame, re-acquired based on the corrected preset change threshold, are output, realizing closed-loop adaptive adjustment. At the same time, the preset change threshold is dynamically corrected according to the interference mode switching frequency within the preset adjustment duration, which can automatically adjust the sensitivity of interference judgment according to changes in production line conditions. This effectively solves the problems of low bus efficiency and easy timeout of real-time messages caused by fixed parameters not adapting to dynamic interference and lack of coordination between retransmission and scheduling.
[0017] Furthermore, by obtaining the maximum value of the power change rate, the strongest electromagnetic interference source on the production line can be captured. By calculating the ratio of this maximum value to a preset change threshold and taking the minimum value of 1, the dimensionless interference intensity coefficient can be compressed to the [0,1] interval. This achieves both normalization and quantification of interference of different degrees and avoids coefficient divergence caused by extreme values of the power change rate. By only determining that noise interference has occurred when the coefficient exceeds the threshold, false triggering caused by background power fluctuations under normal operating conditions can be filtered out.
[0018] Furthermore, by calculating burst concentration, the temporal distribution characteristics of errors can be quantified. High kurtosis indicates that errors are concentrated in a few windows, providing a statistical basis for distinguishing between pulse-type and continuous interference. By calculating the verification correlation coefficient, positive correlation indicates the continuous impact of interference, complementing kurtosis and enhancing the ability to identify continuous interference. In addition, interference verification correlation measures the causal consistency between power changes and bus bit errors. When the two are highly correlated, it indicates a direct relationship between the interference source and the bit error, providing a basis for further distinguishing between ordinary pulses and strong excitation. By constructing an interference persistence factor, a significantly high value is output only when the interference intensity is stable and synchronized with the bit error, filtering out misjudgments caused by random fluctuations or weak correlations. At the same time, when burst concentration is high, interference verification correlation is low, and persistence factor is high, it is judged as a strong excitation mode, i.e., dense pulses and continuous interference; when burst concentration is low and interference verification correlation is high, it is judged as a continuous mode, avoiding the one-sidedness of comparing single parameter thresholds.
[0019] Furthermore, when the interference mode is continuous and the average failure rate is below the preset failure threshold, it indicates good channel quality and a low bit error rate. In this case, appropriately increasing the frame length can increase the effective payload ratio and reduce frame header overhead, thereby improving bus transmission efficiency. Simultaneously, since the interference is continuous and of low intensity, increasing the frame length will not significantly worsen the retransmission risk. Conversely, when the interference mode is strongly excitation and the average failure rate is above the preset failure threshold, it indicates the presence of strong and dense electromagnetic pulses. The frame length must be quickly reduced to shorten the time window during which a single frame is exposed to the pulse, reducing the probability of pulse coverage and avoiding real-time performance loss due to frequent retransmissions. Since changes in frame length alter the time a frame occupies on the bus, longer frames have a greater blocking effect on subsequent queues. Therefore, they should be assigned a higher urgency, making the scheduler more inclined to prioritize sending larger frames, reducing overall queuing delay. The single-frame transmission time is calculated using the adjusted frame length and bus rate, and a pressure correction factor is constructed to correct the time pressure coefficient. Furthermore, in strong excitation mode, due to frequent retransmissions under high error rates, urgent frames with lower priority may miss their deadlines due to multiple retransmissions. Increasing their weight allows them to obtain higher transmission priority in the scheduling queue, ensuring that critical real-time messages are delivered on time even under strong interference. In the CAN bus scheduling of automotive production lines, when the remaining valid duration of a message frame approaches zero, the frame must be transmitted within a very short time, otherwise a timeout failure will occur. At this point, the urgency should increase explosively rather than non-linearly. The exponential function has the characteristic of a sharp increase in slope when the correction pressure coefficient increases, reflecting the physical demand for priority transmission near the deadline. In contrast, the linear function has insufficient growth rate when the remaining valid duration is extremely small, easily causing critical frames to be blocked at the last moment. Simultaneously, to prevent the exponential model from causing some frames to have excessively high urgency and suppress other frames for an extended period, further exponential functions are needed.
[0020] Furthermore, by sorting all data frames in descending order of their transmission urgency and selecting frames exceeding a preset urgency threshold as candidate escalation frames, it is possible to ensure that bus resources are prioritized for the most urgently needed messages. The escalation time increment is calculated by multiplying the number of candidate escalation frames by a pre-calibrated extraction time, quantifying the total time cost of scheduling intervention into a calculable linear model. This suppresses the bus efficiency degradation caused by excessive escalation while ensuring the real-time performance of critical messages.
[0021] Furthermore, by extracting the pulse coverage probability based on the number of verification failures and calculating the expected transmission time of a single frame based on geometric distribution, the retransmission cost is quantified into an analytical expression directly related to the pulse coverage probability. This allows the joint transmission duration to objectively reflect the impact of frame length on anti-interference performance. Based on this, by fixing the number of candidate upgrade frames, the current frame length and its joint transmission duration after increasing or decreasing by a preset step are compared. The frame length corresponding to the smallest comparison is selected as the iteration result. This achieves single-step optimal adjustment of the frame length with minimal computational overhead, avoiding the complex iteration of global search. Further fixing the adjusted frame length, by increasing or decreasing one candidate upgrade frame and recalculating the joint transmission duration, the set of candidate frames that minimizes the joint transmission duration is selected as the target upgrade frame, effectively balancing the timely transmission of critical frames with bus fragmentation control.
[0022] Furthermore, by calculating the handover deviation, the instability of the interference mode was quantified. Simultaneously, the check deviation was calculated, reflecting the direction and magnitude of the deviation between the actual channel bit error rate and the normal baseline. When calculating the joint adjustment factor, the sign of the product was used to determine whether the two deviations had opposite signs. When the handover deviation was positive and the check deviation was negative, it indicated that the interference mode switched frequently but the actual bit error rate was low, suggesting that the preset change threshold was set too low, causing excessive triggering of noise interference. Conversely, when the handover deviation was negative and the check deviation was positive, it indicated that the interference mode changed little but the bit error rate was high, suggesting that the threshold was too high, causing strong interference to not be identified in time. Threshold adjustment was only performed when the joint adjustment factor was negative, and the direction of increase or decrease was clearly defined based on the positive or negative combination of the deviations, avoiding misadjustment of the threshold due to overall changes in operating conditions when the deviations were the same. Attached Figure Description
[0023] Figure 1 This is a flowchart of the data link optimization processing method in this embodiment; Figure 2 This is a logic diagram for determining the occurrence of noise interference in this embodiment; Figure 3 This embodiment defines the logic diagram for determining the interference mode as the strong excitation mode. Figure 4 This embodiment defines the logic diagram for determining the increase of the preset frame length. Detailed Implementation
[0024] To make the objectives and advantages of the present invention clearer, the present invention will be further described below with reference to embodiments; it should be understood that the specific embodiments described herein are merely for explaining the present invention and are not intended to limit the present invention.
[0025] Preferred embodiments of the present invention will now be described with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are merely illustrative of the technical principles of the present invention and are not intended to limit the scope of protection of the present invention.
[0026] Please see Figure 1 This is a flowchart of the data link optimization processing method in this embodiment. This embodiment provides a data link optimization processing method, including: The system acquires in real time the number of failed cyclic redundancy check (CR) checks on the CAN bus of the automotive production line, the waiting time and remaining valid time of each CAN data frame sent in the CAN controller's transmit buffer queue with preset frame length and preset priority weight, and the power change rate of high-power equipment, which are spot welding machines and stamping machines in the automotive production line. The interference intensity coefficient is determined based on the power change rate and the preset change threshold, and whether noise interference occurs is determined based on the threshold comparison result of the interference intensity coefficient. The interference mode is determined based on the number of verification failures and the interference intensity coefficient after noise interference occurs; The preset frame length is adjusted according to the interference mode and the number of verification failures to obtain the adjusted frame length, and the urgency of sending each message frame is determined according to the time pressure coefficient and the preset priority weight, wherein the time pressure coefficient is determined based on the waiting time and the remaining effective time. Based on the threshold comparison result of the sending urgency, several candidate upgrade frames are determined, and the upgrade duration increment is determined based on the number of candidate upgrade frames. The joint transmission duration is determined based on the number of verification failures and the upgrade duration increment, and the adjusted frame length or the candidate upgrade frame is iterated based on the joint transmission duration to obtain the iterated frame length and the target upgrade frame. Output the iteration frame length and the target upgrade frame; The preset change threshold is adjusted based on the switching frequency of the interference mode and the number of verification failures within the preset adjustment period.
[0027] In this embodiment, the CAN bus is a controller area network bus. High-power devices refer to equipment on an automotive production line with a single rated power of 50 kilowatts or greater, or an instantaneous power change rate exceeding 5000 watts / second during start-up, shutdown, and load surges. The data link optimization processing method is applied to the automotive production line environment, which deploys a large number of automated devices, including welding robots, conveyor belt drive motors, assembly robotic arms, and various sensors. These devices are interconnected via the CAN bus to transmit critical real-time data such as emergency stop commands, motion control parameters, and position feedback signals. Multiple high-power devices, such as spot welding machines and stamping machines, exist on the production line. During start-up, shutdown, and operation, they generate strong electromagnetic pulses that interfere with the signal quality on the CAN bus, leading to data frame corruption or retransmission. Furthermore, different control commands have vastly different timeliness requirements; for example, emergency stop signals must arrive within microseconds, while status monitoring data can tolerate millisecond delays. Due to limited bus bandwidth and contention among multiple devices for transmission, low-priority messages may be blocked for extended periods under high load, potentially causing critical commands to time out.
[0028] In this embodiment, by acquiring multi-source parameter monitoring data links, the number of failed verifications is the number of erroneous frames detected by the receiver when performing cyclic redundancy check (CRC) on each data frame during CAN bus communication on the automotive production line. This reflects the frequency of transmission errors caused by electromagnetic interference on the bus. The CAN controller chip integrates an error counter, which can be obtained by reading the controller status register or counting the number of CRC-failed frames in the receive interrupt service routine. The waiting time is the time elapsed from when the CAN data frame is placed in the CAN controller's transmit buffer queue to the current moment. This is achieved by recording a timestamp using a high-precision timer of the CPU when the frame is sent to the transmit queue, and then reading the current timestamp and calculating the difference at the scheduling time. The remaining valid time is the time that each CAN data frame must complete before the specified deadline. The remaining time is obtained by subtracting the current time from the absolute deadline set by the application layer, reflecting the real-time urgency of the message. When the software stack of the automotive electronic control unit (ECU) calls the CAN transmission interface, it will attach a time constraint parameter such as relative delay or absolute time. This parameter is converted into the remaining valid duration and stored in the frame descriptor, which is obtained by reading the difference between the real-time clock and the deadline. The power change rate is the derivative of the instantaneous active power of high-power equipment such as welding robots, variable frequency drive motors, and stamping machines on the automotive production line with respect to time when they start, stop, or experience sudden load changes. High-frequency power analyzers can be installed on the separate power supply branches of each high-power equipment to independently sample the voltage and current of each branch at a sampling rate ≥10kHz. The instantaneous power of each equipment is calculated and differentiated, and the maximum value of the power change rate of all equipment is taken as the maximum power change value.
[0029] The preset frame length is the number of bits occupied by the CAN data frame during data link layer transmission. First, the number of valid data segment bytes of all periodically sent message frames on the production line is counted, and the maximum value is taken. Then, the fixed overhead of the CAN standard frame is added. Based on this, its value is usually set between 48 bits and 1088 bits. In this embodiment, it is set to 256 bits, which can cover most real-time control messages within 15 bytes and match the pulse width generated by the spot welding machine on the production line.
[0030] The preset priority weight is the relative priority value of each CAN data frame in the transmit buffer queue. First, a security level coefficient is assigned to each message. Then, the maximum allowable delay time for each message is measured or set. Next, the transmission cycle of the message is measured. Finally, the initial priority score is calculated as security level coefficient × (maximum allowable delay time / transmission cycle) × 100. The higher the score, the more urgent the message. All messages are sorted from largest to smallest according to their initial priority scores. Then, CAN identifiers (IDs) are assigned sequentially (lower IDs correspond to higher priorities). The ID value starts from 0 and increments by 1 for each additional message ID. The high 4 bits of the ID value are then used as the final preset priority weight. Based on this, its value is usually set between 0 and a maximum of (total number of messages - 1). In this embodiment, it is set to 12, which ensures that the transmission delay of the highest priority message does not exceed 1 millisecond in the worst case.
[0031] The preset change threshold is a critical power change rate value used to determine whether a power change in high-power equipment is sufficient to cause electromagnetic interference. This is achieved by recording the instantaneous active power of multiple high-power devices at a sampling rate of 1kHz during normal production line operation and calculating its derivative. Simultaneously, CRC check failure events on the CAN bus are recorded. Correlation analysis is then performed on the absolute value of the instantaneous active power derivative and the number of check failures to calculate the bit error rate per unit time corresponding to different instantaneous active power derivative intervals. The instantaneous active power derivative value at which the bit error rate jumps from 0.1% to 1% is selected as the threshold. Based on this, its value is typically set between 2000 W / s and 8000 W / s. In this embodiment, it is set to 5000 W / s, which effectively distinguishes between normal operating conditions and strong interference conditions.
[0032] The preset adjustment duration is the length of the time window used to statistically analyze the frequency of interference mode switching. This is achieved by identifying the equipment generating periodic electromagnetic interference on the production line and the intervals between interference events; then calculating the least common multiple of the three types of interference event intervals; thirdly, since interference mode switching usually does not occur with every interference event, but requires the accumulation of multiple interference events to cause a mode change, the base window is multiplied by a safety factor. The principle for determining the safety factor is to ensure that at least 10 interference mode switching samples occur within the window, while the window duration does not exceed the shortest response time of the production line's process cycle change, resulting in a safety factor between 4 and 60. The preset adjustment duration is obtained by combining the base window multiplied by a typical safety factor. Based on this, its value is usually set between 5 and 30 seconds; in this embodiment, it is set to 10 seconds, which ensures a sufficient sample size for the statistical analysis of interference mode switching frequency.
[0033] By utilizing the power change rate and preset thresholds to determine whether noise interference occurs, frequent optimization triggers due to environmental fluctuations are avoided. Interference patterns are identified by combining the number of verification failures and the interference intensity coefficient, improving the targeting of the anti-interference strategy. For pulse-type interference, the frame length is dynamically adjusted, and the urgency of transmission is calculated based on the time pressure coefficient and the original priority, ensuring that critical real-time frames still obtain reasonable bandwidth under strong electromagnetic interference. Simultaneously, candidate upgrade frames are screened using the urgency threshold, and the upgrade duration increment is quantified to prevent blind upgrades from exacerbating bus fragmentation. By fusing the pulse coverage probability and the upgrade duration increment into a joint transmission duration, and iteratively optimizing the frame length and candidate upgrade frames, the total transmission time is minimized while ensuring real-time performance. The optimal frame length and target upgrade frame, re-acquired based on the corrected preset change threshold, are output, achieving closed-loop adaptive adjustment. Furthermore, the preset change threshold is dynamically corrected according to the interference mode switching frequency within the preset adjustment duration, automatically adjusting the sensitivity of interference detection according to changes in production line conditions. This effectively solves the problems of low bus efficiency and easy timeouts of real-time messages caused by fixed parameters being unsuitable for dynamic interference and a lack of coordination between retransmission and scheduling.
[0034] Please see Figure 2 As shown, this is the logic diagram for determining the occurrence of noise interference in this embodiment. In this embodiment, the process of determining the interference intensity coefficient based on the power change rate and the preset change threshold, and determining whether noise interference has occurred based on the threshold comparison result of the interference intensity coefficient, includes: The maximum value of the power change rate of all high-power devices is obtained to obtain the maximum power change value, and the ratio of the maximum power change value to the preset change threshold is calculated to obtain the interference intensity coefficient, where G=min(1,P / P0), G is the interference intensity coefficient, P is the maximum power change value, and P0 is the preset change threshold. When the interference intensity coefficient is greater than a preset intensity threshold, noise interference is determined to have occurred.
[0035] The preset intensity threshold is used to determine whether the power change of high-power equipment has reached a critical value of interference intensity coefficient sufficient to cause electromagnetic noise interference on the CAN bus. First, power change rate data is continuously collected for 10 seconds during normal production line operation, i.e., when no high-power equipment is started or stopped. The maximum value of the interference intensity coefficient at each sampling point is taken as the upper limit of background noise. Then, high-power equipment such as spot welding machines and frequency converters are started respectively, and the interference intensity coefficient corresponding to the moment when the number of CAN bus CRC check failures suddenly increases from 0 to more than 5 times per unit time from the start of startup is calculated. Finally, the arithmetic mean of the upper limit of background noise and the interference intensity coefficient that first causes bit error is taken as the preset intensity threshold. Based on this, its value is usually set between 0.2 and 0.5. In this embodiment, it is set to 0.3, which can promptly determine noise interference in the early stage of strong interference events.
[0036] By obtaining the maximum value of the power change rate, the strongest electromagnetic interference source on the production line can be captured. By calculating the ratio of this maximum value to a preset change threshold and taking the minimum value of 1, the dimensionless interference intensity coefficient can be compressed to the [0,1] interval. This achieves both normalization and quantification of interference of different degrees and avoids coefficient divergence caused by extreme values of the power change rate. By only determining that noise interference has occurred when the coefficient exceeds the threshold, false triggering caused by background power fluctuations under normal operating conditions can be filtered out.
[0037] Please see Figure 3 As shown, this is the logic diagram for determining the interference mode as a strong excitation mode in this embodiment. In this embodiment, the process of determining the interference mode based on the number of verification failures and the interference intensity coefficient after noise interference occurs includes: Calculate the average number of verification failures at each time point within the previously preset time period to obtain the verification failure mean, and determine the kurtosis based on the number of verification failures and the verification failure mean to obtain the verification count kurtosis.
[0038] F is the kurtosis of the verification count, N is the number of moments of a preset duration, and C is the number of moments. K The number of verifications at each time point is given, μ is the average number of verification failures, and burst concentration is calculated based on the kurtosis of the number of verifications, where T = min(1, F / F0), where T is the burst concentration and F0 is the preset kurtosis threshold. Calculate the first-order time autocorrelation coefficient of the number of verification failures within the preset time period to obtain the verification correlation coefficient, and calculate the interference intensity coefficient and the Pearson correlation coefficient of the number of verification failures to obtain the interference verification correlation. Calculate the coefficient of variation of the interference intensity coefficient within the preset time period to obtain the interference fluctuation, and determine the interference duration factor based on the interference fluctuation and the interference verification correlation, where X=(1-B G )×R GJ X is the persistence factor of the disturbance, B G It is the disturbance fluctuation, R GJ It is interference to check the correlation; When the burst concentration is greater than a preset concentration threshold, the interference verification correlation is less than a preset correlation threshold, and the interference persistence factor is greater than a preset persistence threshold, the interference mode is determined to be a strong excitation mode. When the burst concentration is less than or equal to the preset concentration threshold, and the interference verification correlation is greater than or equal to the preset correlation threshold, the interference mode is determined to be a continuous mode.
[0039] In this embodiment, when the above conditions are not met, a default mode is set to avoid the system entering an undefined decision state. In the default mode, the preset frame length is not adjusted and the original preset frame length is maintained; the preset priority weight is not increased, and each message frame is still scheduled according to the original preset priority weight; at the same time, the screening of candidate upgrade frames and the calculation of upgrade duration increment are not performed, that is, the active optimization adjustment in this method is suspended, and only basic CAN bus communication is maintained. This default mode can be regarded as a safe and conservative working state, which is equivalent to a mode without significant interference or a mild continuous interference mode. It can wait for subsequent data to re-trigger a complete interference mode determination without introducing erroneous adjustments. In addition, due to sampling noise, numerical comparison tolerance, or transient fluctuations during parameter measurement, a set of data may simultaneously meet the determination conditions of both the strong excitation mode and the continuous mode. To avoid logical conflicts that lead to decision confusion, since the dense, high-intensity electromagnetic pulses represented by the strong excitation mode are significantly more destructive to bus communication than the stable interference in the continuous mode, a clear mode priority is set: the priority of the strong excitation mode is higher than that of the continuous mode, and the priority of the continuous mode is higher than that of the default mode. When the conditions for both strong excitation mode and continuous mode are met simultaneously, the system processes the system according to the strong excitation mode, that is, it prioritizes strategies to deal with pulse-type strong interference, such as reducing frame length and increasing preset priority weight.
[0040] The preset duration is the length of the time window used to collect data on the number of verification failures and interference intensity coefficients. It is achieved by measuring the duration of continuous pulse trains generated by interference sources such as spot welding machine discharge and frequency converter switching using an oscilloscope or bus analyzer, taking the maximum value of the duration of each interference source, and then calculating the minimum number of samples required to ensure the stability of kurtosis and autocorrelation coefficient calculations based on a preset sampling interval, such as 10ms. Typically, no less than 20 samples are required, corresponding to the minimum time length. Finally, the larger value between the interference duration and the minimum time length is taken as the preset duration. Based on this, its value is usually set between 2 and 6 seconds. In this embodiment, it is set to 3 seconds, which can fully cover the duration of most pulse interference and meet the statistical sample size requirements.
[0041] The preset kurtosis threshold is a reference value used to normalize the kurtosis value of the number of verification failures into a burst concentration index. It is obtained by collecting a sequence of verification failures when there is no significant interference on the production line, calculating its kurtosis, and obtaining a theoretical value close to a normal distribution. Then, 30 sets of data are collected under typical pulse interference such as spot welding discharge, and the kurtosis value is calculated. The maximum value from multiple measurements is taken as the upper bound. Finally, this upper bound value is set as the preset kurtosis threshold, which is typically set between 8 and 15. In this embodiment, it is set to 10, which enables effective burst concentration quantification.
[0042] The preset concentration threshold is a critical burst concentration value used to determine whether the number of verification failures has significant burst concentration characteristics. It is achieved by continuously collecting multiple sets of data under no interference or continuous interference, calculating the burst concentration of each set of data, and taking the maximum value as the normal baseline. Then, the data is collected repeatedly under typical impulse interference, and the burst concentration is calculated. The minimum value is taken as the interference baseline. Finally, the arithmetic mean of the normal baseline and the interference baseline is calculated as the preset concentration threshold. Based on this, its value is usually set between 0.5 and 0.7. In this embodiment, it is set to 0.6, which can effectively distinguish between impulse and non-impulse interference.
[0043] The preset correlation threshold is a critical Pearson correlation coefficient value used to determine whether there is a significant linear correlation between the interference intensity coefficient and the number of verification failures. Under interference-free conditions, multiple sets of corresponding data on the interference intensity coefficient and the number of verification failures are collected, the Pearson correlation coefficient is calculated, and its distribution is statistically analyzed. The upper quantile at the 99% confidence level is taken as the upper bound of the background. Then, under strong electromagnetic interference, such as frequent start-ups and shutdowns of high-power equipment, 30 sets of data are collected to calculate the correlation coefficient, and the lower quantile at the 99% confidence level is taken as the lower bound of strong coupling. Finally, the midpoint between the upper bound of the background and the lower bound of strong coupling is taken as the preset correlation threshold. Based on this, its value is usually set between 0.3 and 0.5. In this embodiment, it is set to 0.4, which ensures that strong coupling is only determined when the two have a moderate or higher positive correlation.
[0044] The preset duration threshold is a critical value used to determine whether the interference duration factor has reached the standard of the strong excitation mode. By collecting 30 sets of data under normal pulse interference, such as a single spot welding, the interference duration factor of each set is calculated, and the maximum value is taken as the upper limit of the normal mode. Then, under strong excitation interference, such as continuous spot welding or repeated frequency adjustment of the frequency converter, the interference duration factor is calculated, and the minimum value is taken as the lower limit of the strong excitation mode. Finally, the arithmetic mean of the upper limit of the normal mode and the upper limit of the strong excitation mode is taken as the preset duration threshold. Based on this, its value is usually set between 0.3 and 0.5. In this embodiment, it is set to 0.4, which can effectively distinguish between normal pulse interference and strong excitation interference.
[0045] By calculating burst concentration, the temporal distribution characteristics of errors can be quantified. High kurtosis indicates that errors are concentrated in a few windows, providing a statistical basis for distinguishing between pulse-type and continuous interference. Calculating the verification correlation coefficient shows that positive correlation indicates the persistent impact of interference, complementing kurtosis and enhancing the ability to identify continuous interference. Furthermore, the interference verification correlation measures the causal consistency between power changes and bus bit errors. When the two are highly correlated, it indicates a direct relationship between the interference source and the bit errors, providing a basis for further distinguishing between ordinary pulses and strong excitation. By constructing an interference persistence factor, a significantly high value is output only when the interference intensity is stable and synchronized with the bit errors, filtering out misjudgments caused by random fluctuations or weak correlations. Simultaneously, when burst concentration is high, interference verification correlation is low, and persistence factor is high, it is judged as a strong excitation mode (i.e., dense pulses and persistent interference); when burst concentration is low and interference verification correlation is high, it is judged as a continuous mode, avoiding the one-sidedness of comparing single parameter thresholds.
[0046] Please see Figure 4 As shown, this is the logic diagram for determining the increase of the preset frame length in this embodiment. In this embodiment, the process of adjusting the preset frame length according to the interference mode and the number of verification failures to obtain the adjusted frame length includes: When the interference mode is the continuous mode and the average number of verification failures is less than the preset failure threshold, the preset frame length is increased according to the preset first step length to obtain the adjusted frame length. When the interference mode is the strong excitation mode and the average number of verification failures is greater than the preset failure threshold, the preset frame length is decreased according to the preset second step length to obtain the adjusted frame length. Otherwise, the current frame length remains unchanged in all other cases to ensure the integrity of the control logic and the stability of operation.
[0047] Specifically, the urgency of sending each message frame is determined based on a time pressure coefficient and a preset priority weight. The process of determining the time pressure coefficient based on the already waited time and the remaining valid time includes: Obtain the CAN bus rate of the automotive production line CAN bus, and calculate the ratio of the adjusted frame length to the CAN bus rate to obtain the transmission time of a single frame; The time pressure coefficient is determined based on the ratio of the already waited time to the remaining effective time, where S=T Y / T S +r, S is the time-pressure coefficient, T Y This is the waiting time, T S This is the remaining valid duration, and r is the decimal point to prevent division by zero; in this embodiment, it is set to 1 microsecond. The pressure correction factor is determined based on the single-frame transmission time, where X Y =1+H / H0, X Y H is the pressure correction factor, H is the single frame transmission time, H0 is the preset time threshold, and the correction pressure coefficient is determined by the product of the pressure correction factor and the time pressure coefficient. When the interference mode is the strong excitation mode, the preset priority weight is increased according to the average failure rate of the verification and the preset failure threshold to obtain the adjusted priority weight, wherein W T =W0×(1+J S / J S0 ), W T It adjusts the priority weights; W0 is the preset priority weight, and J... S It is the average of failed validations, J S0 It is a preset failure threshold, and the sending urgency is determined based on the modified pressure coefficient and adjusted priority weight, wherein,
[0048] F S It indicates the urgency of sending, X YS It is a corrected pressure coefficient.
[0049] The preset failure threshold is a critical average number of verification failures used to determine whether the current number of verification failures exceeds the normal range, thereby triggering frame length adjustment. This is achieved by continuously collecting 30 sets of verification failure counts within a preset time period during normal production line operation, and taking the maximum value of the average over all time periods as the normal baseline. Then, under typical strong interference conditions such as continuous discharge from a spot welding machine, 30 sets of data are collected, and the minimum value of the average number of verification failures is taken as the interference baseline. Finally, the arithmetic mean of the normal baseline and the interference baseline is taken as the preset failure threshold. Based on this, its value is usually set between 2 and 8 times per second. In this embodiment, it is set to 5 times per second, which can effectively distinguish between normal background noise and the increase in bit errors caused by strong electromagnetic interference.
[0050] The preset first step length is used to increase the current frame length by a fixed percentage each time when there is continuous interference and the average number of verification failures is lower than the preset failure threshold. The preset first step length is taken as one-tenth of the frame length variation range allowed by the CAN bus, i.e., 10%. This means that it takes about 10 adjustments to go from the minimum frame length to the maximum frame length. This can smoothly respond to changes in channel quality without causing sluggish response due to too small a step length or transmission oscillation caused by too large a step length. Based on this, its value is usually set between 5% and 15%. In this embodiment, it is set to 10%, which can effectively improve the transmission efficiency while ensuring the smoothness of the adjustment.
[0051] The preset second step length is a fixed percentage used to reduce the current frame length each time when the average number of verification failures is higher than the preset failure threshold in strong excitation mode. It is calculated based on the CAN bus speed and typical pulse width to avoid the probability of a single frame being hit by a pulse exceeding the tolerance value. Then, the ratio of the current typical frame length to this safety limit is used as the preset second step length. Based on this, its value is usually between 15% and 40%. In this embodiment, it is set to 20%, which can quickly shorten the frame length when strong interference occurs and effectively reduce the probability of pulse coverage.
[0052] The preset time threshold is a reference time value used to normalize the transmission time of a single frame and calculate the pressure correction factor. It is determined by statistically analyzing the length distribution of all periodically transmitted frames on the production line and selecting the frame length with the highest frequency as the typical frame length. Then, the transmission time for this typical frame length is calculated based on the CAN bus rate and used as the preset time threshold. Based on this, its value is typically set between 200 microseconds and 800 microseconds. In this embodiment, it is set to 500 microseconds, which effectively reflects the correction magnitude of frame length changes on the pressure coefficient.
[0053] When the interference mode is continuous and the average failure rate is below the preset failure threshold, it indicates good channel quality and a low bit error rate. In this case, appropriately increasing the frame length can increase the effective payload ratio and reduce frame header overhead, thereby improving bus transmission efficiency. Since the interference is continuous and of low intensity, increasing the frame length will not significantly worsen the retransmission risk. Conversely, when the interference mode is strongly excitation-mode and the average failure rate is above the preset failure threshold, it indicates the presence of strong and dense electromagnetic pulses. The frame length must be quickly reduced to shorten the time window during which a single frame is exposed to the pulse, reducing the probability of pulse coverage and avoiding real-time performance loss due to frequent retransmissions. Since changes in frame length alter the time a frame occupies on the bus, longer frames have a greater blocking effect on subsequent queues. Therefore, they should be assigned a higher urgency rating, making the scheduler more inclined to prioritize sending larger frames, reducing overall queuing delay. The single-frame transmission time is calculated using the adjusted frame length and bus rate, and a pressure correction factor is constructed to adjust the time pressure coefficient. Furthermore, in strong excitation mode, due to frequent retransmissions under high error rates, urgent frames with lower priority may miss their deadlines due to multiple retransmissions. Increasing their weight allows them to obtain higher transmission priority in the scheduling queue, ensuring that critical real-time messages are delivered on time even under strong interference. In the CAN bus scheduling of automotive production lines, when the remaining valid duration of a message frame approaches zero, the frame must be transmitted within a very short time, otherwise a timeout failure will occur. At this point, the urgency should increase explosively rather than non-linearly. The exponential function has the characteristic of a sharp increase in slope when the correction pressure coefficient increases, reflecting the physical demand for priority transmission near the deadline. In contrast, the linear function has insufficient growth rate when the remaining valid duration is extremely small, easily causing critical frames to be blocked at the last moment. Simultaneously, to prevent the exponential model from causing some frames to have excessively high urgency and suppress other frames for an extended period, further exponential functions are needed.
[0054] Specifically, the process of determining several candidate upgrade frames based on the threshold comparison result of the transmission urgency, and determining the upgrade duration increment based on the number of candidate upgrade frames, includes: The transmission urgency of all the CAN data frames is sorted in descending order to obtain a descending sequence of transmission urgency, and the CAN data frames in the descending sequence of transmission urgency whose transmission urgency is greater than a preset emergency threshold are selected as the candidate upgrade frames. The pre-calibrated extraction time of each CAN data frame is obtained, and the product of the number of candidate upgrade frames and the pre-calibrated extraction time is calculated to determine the upgrade time increment.
[0055] In this embodiment, the pre-calibrated extraction time refers to the fixed bus idle time additionally occupied when the bus scheduler elevates the CAN data frame to a higher priority so that it can be sent in the queue. This is due to the need to perform bus arbitration, frame interval waiting, and the switching of the transmitting node from the receiving state to the transmitting state. On the target ECU, the average time for sending a frame without any elevation is measured, and the additional time for sending the same frame after performing an elevation (i.e., moving a frame from the back of the queue to the front) is taken as the difference. This time mainly includes: ① the interrupt response and task switching time of the CPU switching from the current transmitting task to the elevation decision task; ② the memory operation time for modifying the transmit buffer descriptor or queue pointer; ③ the additional bus idle waiting that may be introduced due to changes in the transmission order.
[0056] The preset emergency threshold is a critical value for the urgency of sending candidate frames that need to be temporarily prioritized, selected from the sending queue. By continuously collecting the urgency values of all message frames within 10 minutes when the production line is running normally and there is no additional interference, and plotting their cumulative distribution curve, the 80th percentile is selected as the basic threshold. Based on this, its value is usually set between 1.5 and 5.0. In this embodiment, it is set to 2.5, which can ensure that key frames are sent in a timely manner, while avoiding excessive prioritization that would exacerbate bus fragmentation.
[0057] By sorting all data frames by their transmission urgency in descending order and selecting frames exceeding a preset urgency threshold as candidate escalation frames, it is ensured that bus resources are prioritized for the most urgently needed messages. The escalation time increment is calculated by multiplying the number of candidate escalation frames by a pre-calibrated extraction time, quantifying the total time cost of scheduling intervention into a calculable linear model. This approach suppresses the bus efficiency degradation caused by excessive escalation while ensuring the real-time performance of critical messages.
[0058] Specifically, the process of determining the joint transmission duration based on the number of verification failures and the upgrade duration increment, and iterating the adjusted frame length or the candidate upgrade frames based on the joint transmission duration to obtain the iterated frame length and the target upgrade frame includes: The pulse coverage probability is determined based on the number of verification failures, the expected single-frame latency is determined based on the pulse coverage probability and the adjusted frame length, and the joint transmission duration is determined based on the sum of the expected single-frame latency and the upgrade duration increment. The number of candidate upgrade frames is fixed. The joint transmission duration is calculated after the adjustment frame length is increased by one preset first step length to obtain the first transmission step length. The joint transmission duration is calculated after the adjustment frame length is decreased by one preset first step length to obtain the second transmission step length. Among the joint transmission duration, the first transmission step length, and the second transmission step length, if the first transmission step length is the smallest, the iteration frame length is the sum of the adjustment frame length and the preset first step length. If the second transmission step length is the smallest, the iteration frame length is the difference between the adjustment frame length and the preset first step length. Otherwise, the iteration frame length is the adjustment frame length. The length of the adjustment frame is fixed. The joint transmission duration after extracting one CAN data frame from the descending order of transmission urgency as the candidate upgrade frame is subtracted to obtain the first joint duration. The joint transmission duration after reducing the number of candidate upgrade frames by one is calculated to obtain the second joint duration. Among the joint transmission duration, the first joint step size, and the second joint step size, if the first joint step size is the smallest, then the target upgrade frame is all the candidate upgrade frames after adding one candidate upgrade frame. If the second joint step size is the smallest, then the target upgrade frame is all the candidate upgrade frames after reducing one candidate upgrade frame. Otherwise, the target upgrade frame is all the candidate upgrade frames.
[0059] In this embodiment, in each iteration, a fixed number of candidate upgrade frames and a fixed adjustment frame length are executed sequentially. After each trial, the joint transmission time is recalculated, and the current optimal frame length and candidate upgrade frame set are recorded respectively. The termination condition of the iteration is that the relative change rate of the joint transmission time obtained by two consecutive iterations is less than the preset convergence threshold, indicating that the improvement of the total transmission time by further optimization can be ignored.
[0060] The preset convergence threshold is a critical value used to determine whether the iterative optimization should continue. It is determined by analyzing the actual resolution of CAN bus time measurement and the minimum resolvable change in joint transmission duration caused by adjustments to frame length and the number of candidate upgrade frames. The typical fluctuation range of the relative change rate between two adjacent iterations is statistically analyzed through 50 offline simulations. Then, combined with the maximum number of iterations allowed by online optimization, a threshold is selected that can ensure convergence within a finite number of steps and will not terminate prematurely due to noise. It is usually set between 0.5% and 5%. In this embodiment, it is set to 1%, which can achieve a good balance between algorithm convergence speed and optimization accuracy.
[0061] Specifically, the process of determining the pulse coverage probability based on the number of verification failures includes: Extract the number of verification failures at each time point within the preset time period to obtain a verification failure sequence; The duration for which the number of consecutive verification failures exceeds a preset pulse threshold is recorded as a verification window. The average duration of all verification windows is calculated to obtain the average pulse width, and the time interval between adjacent verification windows is recorded as the average pulse interval. The pulse coverage probability is determined based on the average pulse width, the adjusted frame length, and the average pulse interval, where M = min[1, (K M +L f / v) / I M M is the pulse coverage probability, K M It is the average pulse width, L f This refers to adjusting the frame length, where v is the CAN bus speed, and I is the I value. M It is the average pulse interval.
[0062] Specifically, the process of determining the expected single-frame latency based on the pulse coverage probability and the adjusted frame length, and determining the joint transmission duration based on the sum of the expected single-frame latency and the upgrade duration increment, includes: The expected time for a single frame is determined based on the pulse coverage probability and the adjusted frame length, where Q=L f / v×[1+M / (1-M)], where Q is the expected time per frame; The sum of the expected single-frame duration and the upgrade duration increment is calculated to obtain the joint transmission duration.
[0063] In this embodiment, the pulse coverage probability model used is a simplified model based on statistical averaging. It implicitly assumes that the electromagnetic pulse sequence has weak stationarity, meaning that within a predetermined time period, the arrival interval and pulse width of the pulses can be approximated by their arithmetic mean. Each pulse has an average duration, i.e., an average pulse width, and the average silence interval between adjacent pulses is the average pulse interval. The pulse occurrence time relative to the start time of data frame transmission can be considered as a uniform random distribution. The time window length required for the data frame to be transmitted from start to end is L. f / v. Under this setting, the necessary and sufficient condition for a frame to overlap with any pulse is that the time window of the frame and the time window of a certain pulse have a non-empty intersection on the time axis. Based on the nature of the update process, for a randomly arriving frame that is independent of the pulse process, its overlap with a pulse centered on a certain pulse and of length K... M +L fThe probability within the extended interval of / v is exactly equal to the proportion of the extended interval length to the average pulse interval. The principle is that each pulse actually sweeps across a dangerous region on the time axis, including its own width and the frame transmission window, and the proportion of this region in the entire cycle constitutes the overlap probability. When the calculated ratio is greater than or equal to 1, it means that the pulse interval is less than the sum of the frame transmission window and the pulse width. At this point, regardless of when the frame is sent, its time window cannot avoid all pulses, and the overlap probability saturates to 1. Therefore, the formula takes the minimum value to correctly reflect the physical limit, which conforms to the randomness assumption of industrial sites and meets the needs of online real-time calculation, providing a solid probabilistic basis for the subsequent quantification of retransmission expectations and joint transmission duration.
[0064] The preset pulse threshold is a critical number of times used to determine whether the number of verification failures within the current time window indicates the presence of electromagnetic pulse interference. It depends on the number of verification failures collected continuously in 100 sampling windows under typical interference conditions on the production line. The minimum non-zero value is taken as the threshold. That is, within 1 second after the main interference sources such as welding machines and frequency converters are started, the number of CRC verification failures in each 10-millisecond window is recorded. After removing zero values, the minimum value is taken. This minimum value is the number of failures corresponding to the weakest pulse. Based on this, its value is usually set between 1 and 3 times per sampling window. In this embodiment, it is set to 1 time per window, which can accurately count the pulse width and interval.
[0065] By extracting the pulse coverage probability based on the number of verification failures and calculating the expected transmission time of a single frame based on geometric distribution, the retransmission cost is quantified into an analytical expression directly related to the pulse coverage probability. This allows the joint transmission duration to objectively reflect the impact of frame length on anti-interference performance. Furthermore, by fixing the number of candidate upgrade frames, the current frame length and its joint transmission duration after increasing or decreasing by a preset step size are compared. The frame length corresponding to the smallest comparison is selected as the iteration result. This achieves single-step optimal adjustment of the frame length with minimal computational overhead, avoiding the complex iteration of global search. Further fixing the adjusted frame length, by increasing or decreasing one candidate upgrade frame and recalculating the joint transmission duration, the set of candidate frames that minimizes the joint transmission duration is selected as the target upgrade frame, effectively balancing the timely transmission of critical frames with bus fragmentation control.
[0066] Specifically, the process of adjusting the preset change threshold based on the switching frequency of the interference mode and the number of verification failures within a preset adjustment period includes: Calculate the ratio of the number of times the interference mode is switched within the preset adjustment time to the preset adjustment time to obtain the mode switching frequency, and calculate the relative deviation between the mode switching frequency and the preset frequency threshold to obtain the switching deviation. Calculate the relative deviation between the average number of verification failures and the preset failure threshold within the preset adjustment period to obtain the verification deviation, and calculate the product of the switching deviation and the verification deviation to obtain the joint adjustment factor; Based on the fact that the joint adjustment factor is negative, when the switching deviation is positive and the verification deviation is negative, the preset change threshold is increased according to the preset change step size, and when the switching deviation is negative and the verification deviation is positive, the preset change threshold is decreased according to the preset change step size.
[0067] The preset change step size is a fixed percentage adjustment range used each time the preset change threshold is adjusted. By analyzing the shortest time required for a significant change in the power change characteristics of typical interference sources in the production line, such as spot welding machines and frequency converters, it is set to complete 2 to 3 threshold adjustments within this time to achieve stability. Then, combined with the preset adjustment time and the allowable threshold adjustment range, such as 2000W / s to 8000W / s, it is estimated that the proportion of each adjustment should ensure that the single adjustment change does not exceed 20% of the total range to avoid over-adjustment. Finally, this proportion is taken as the preset change step size. Based on this, its value is usually set between 5% and 20%. In this embodiment, it is set to 10% to ensure responsiveness to changes in operating conditions and avoid system oscillation caused by excessive step size.
[0068] By calculating the handover deviation, the instability of the interference mode is quantified. Simultaneously, the check deviation is calculated, reflecting the direction and magnitude of the deviation between the actual channel bit error rate and the normal baseline. When calculating the joint adjustment factor, the sign of the product is used to determine whether the two deviations have opposite signs. When the handover deviation is positive and the check deviation is negative, it indicates frequent interference mode switching but a low actual bit error rate, suggesting that the preset change threshold is set too low, causing excessive triggering of noise interference. Conversely, when the handover deviation is negative and the check deviation is positive, it indicates that the interference mode changes little but the bit error rate is high, suggesting that the threshold is too high, causing strong interference to be undetected in time. Threshold adjustment is only performed when the joint adjustment factor is negative, and the direction of increase or decrease is clearly defined based on the positive or negative combination of the deviations, avoiding misadjustment of the threshold due to overall changes in operating conditions when the deviations are the same.
[0069] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A data link optimization processing method, characterized in that, include: The system acquires in real time the number of failed cyclic redundancy check (CR) checks on the CAN bus of the automotive production line, the waiting time and remaining valid time of each CAN data frame sent in the CAN controller's transmit buffer queue with preset frame length and preset priority weight, and the power change rate of high-power equipment, which are spot welding machines and stamping machines in the automotive production line. The interference intensity coefficient is determined based on the power change rate and the preset change threshold, and whether noise interference occurs is determined based on the threshold comparison result of the interference intensity coefficient. The interference mode is determined based on the number of verification failures and the interference intensity coefficient after noise interference occurs; The preset frame length is adjusted according to the interference mode and the number of verification failures to obtain the adjusted frame length, and the urgency of sending each message frame is determined according to the time pressure coefficient and the preset priority weight, wherein the time pressure coefficient is determined based on the waiting time and the remaining effective time. Based on the threshold comparison result of the sending urgency, several candidate upgrade frames are determined, and the upgrade duration increment is determined based on the number of candidate upgrade frames. The joint transmission duration is determined based on the number of verification failures and the upgrade duration increment, and the adjusted frame length or the candidate upgrade frame is iterated based on the joint transmission duration to obtain the iterated frame length and the target upgrade frame. Output the iteration frame length and the target upgrade frame; The preset change threshold is adjusted based on the switching frequency of the interference mode and the number of verification failures within the preset adjustment period.
2. The data link optimization processing method according to claim 1, characterized in that, The process of determining the interference intensity coefficient based on the power change rate and a preset change threshold, and determining whether noise interference has occurred based on the threshold comparison result of the interference intensity coefficient, includes: The interference intensity coefficient is determined based on the ratio of the maximum power change rate to the preset change threshold. The occurrence of noise interference is determined based on the threshold comparison result of the interference intensity coefficient.
3. The data link optimization processing method according to claim 2, characterized in that, The process of determining the interference mode based on the number of verification failures and the interference intensity coefficient after noise interference occurs includes: The burst concentration is determined based on the historical average number of verification failures and the number of verification failures. The verification correlation coefficient is determined based on the autocorrelation characteristics of the number of verification failures, and the interference verification correlation degree is determined based on the interference intensity coefficient and the correlation characteristics of the number of verification failures. The interference fluctuation degree is determined based on the discrete characteristics of the interference intensity coefficient, and the interference duration factor is determined based on the interference fluctuation degree and the interference verification correlation. The interference mode is determined based on the threshold comparison results of the burst concentration, the interference verification correlation, and the interference persistence factor.
4. The data link optimization processing method according to claim 3, characterized in that, The process of adjusting the preset frame length based on the interference mode and the number of verification failures includes: The preset frame length is adjusted based on the threshold comparison result between the interference mode and the average value of the verification failure to obtain the adjusted frame length.
5. The data link optimization processing method according to claim 4, characterized in that, The urgency of sending each message frame is determined based on a time pressure coefficient and a preset priority weight. The process of determining the time pressure coefficient based on the already waited time and the remaining valid time includes: Obtain the CAN bus rate of the automotive production line CAN bus, and determine the single frame transmission time based on the adjusted frame length and CAN bus rate; The time pressure coefficient is determined based on the waiting time and the remaining effective time. The pressure correction factor is determined based on the single frame transmission time, and the correction pressure coefficient is determined based on the pressure correction factor and the time pressure coefficient. Based on the interference mode, the adjustment priority weight is determined according to the average verification failure, the preset priority weight, and the preset failure threshold, and the transmission urgency is determined according to the correction pressure coefficient and the adjustment priority weight.
6. The data link optimization processing method according to claim 5, characterized in that, The process of determining several candidate upgrade frames based on the threshold comparison result of the sending urgency, and determining the upgrade duration increment based on the number of candidate upgrade frames, includes: Based on the transmission urgency of the CAN data frame, a descending sequence of transmission urgency is determined, and the CAN data frame is sequentially determined as the candidate upgrade frame based on the threshold comparison results of the transmission urgency in the descending sequence of transmission urgency. The pre-calibrated extraction time of each CAN data frame is obtained, and the upgrade duration increment is determined based on the number of candidate upgrade frames and the pre-calibrated extraction time.
7. The data link optimization processing method according to claim 6, characterized in that, The process of determining the joint transmission duration based on the number of verification failures and the upgrade duration increment, and iterating the adjusted frame length or the candidate upgrade frames based on the joint transmission duration to obtain the iterated frame length and the target upgrade frame includes: The pulse coverage probability is determined based on the number of verification failures, the expected single-frame latency is determined based on the pulse coverage probability and the adjusted frame length, and the joint transmission duration is determined based on the sum of the expected single-frame latency and the upgrade duration increment. The number of candidate upgrade frames is fixed, and the adjustment frame length that minimizes the joint transmission duration is selected as the iteration frame length by comparing the current adjustment frame length with the joint transmission duration after the adjustment of its adjacent step lengths. The length of the adjustment frame is fixed, and the candidate upgrade frame that minimizes the joint transmission time of the current candidate upgrade frame and its adjacent frames after adding or subtracting one frame is selected as the target upgrade frame.
8. The data link optimization processing method according to claim 7, characterized in that, The process of determining the pulse coverage probability based on the number of verification failures includes: The verification failure sequence is determined based on the number of verification failures at each moment within the preset time period; Several verification windows are determined based on the threshold comparison results of the number of verification failures in the verification failure sequence, and the average pulse width and average pulse interval are determined based on all the verification windows respectively. The pulse coverage probability is determined based on the average pulse width, the adjusted frame length, and the average pulse interval.
9. The data link optimization processing method according to claim 8, characterized in that, The process of determining the expected single-frame latency based on the pulse coverage probability and the adjusted frame length, and determining the joint transmission duration based on the sum of the expected single-frame latency and the upgrade duration increment, includes: The expected time for a single frame is determined based on the pulse coverage probability and the adjusted frame length. The sum of the expected single-frame duration and the upgrade duration increment is calculated to obtain the joint transmission duration.
10. The data link optimization processing method according to claim 9, characterized in that, The process of adjusting the preset change threshold based on the switching frequency of the interference mode and the number of verification failures within the preset adjustment period includes: The switching deviation is determined based on the degree of deviation of the switching frequency of the interference mode within the preset adjustment period; The verification deviation is determined based on the average deviation of the number of verification failures, and a joint adjustment factor is determined based on the switching deviation and the verification deviation. Based on the signs of the joint adjustment factor, the switching deviation, and the verification deviation, the preset change threshold is adjusted according to a fixed step size.