Intelligent connector communication system based on CAN bus

CN122601411APending Publication Date: 2026-08-18HUNAN LIANBANG ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610865077.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-16
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

这两种方式虽然在形式上减少了单一段落内的节点竞争数量,但并未改变报文自身的静态仲裁属性

Benefits of technology

1.通过解析控制器局域网总线收发报文的仲裁场与数据场,统计低优先级帧的排队延迟时间与总线占用率,当排队延迟时间超过动态延迟阈值且总线占用率高于饱和阈值时,拦截待发送低优先级报文,将低优先级报文仲裁场的标识符替换为预存高优先级虚拟标识符,并将原始标识符移位编码嵌入数据场首部。此机制打破了固定优先级仲裁的技术偏见,使得排队过久的低优先级报文能够临时获得高优先级身份参与仲裁并赢得总线占用权,抑制了控制器局域网总线在高负载状态下的低优先级报文饥饿现象,降低低优先级关键控制报文的传输延迟。按照总线占用率所在区间逐级递减基准延迟系数,缩短了高负载下触发优先级跃迁的等待时长,提升总线信道吞吐量,避免信道拥堵死锁。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122601411A_ABST
    Figure CN122601411A_ABST
Patent Text Reader

Abstract

This invention relates to the field of controller area network (CAN) bus communication in data exchange networks, specifically a smart connector communication system based on a CAN bus. The system parses the message arbitration field and data field, and calculates the queuing delay and bus occupancy rate of low-priority frames. When the queuing delay exceeds a dynamic threshold and the occupancy rate is higher than a saturation threshold, it intercepts the low-priority message to be sent, replaces its arbitration field identifier with a pre-stored high-priority virtual identifier, and embeds the original identifier in the data field header using a shift encoding. Before the message successfully obtains bus occupancy rights through arbitration and before the data field is sent, the original identifier in the data field header is restored to the arbitration field, the shift encoding bits are removed, and micro-timeslot compensation bits are inserted based on the bus idle time slots for transmission. This invention suppresses low-priority message starvation under high bus load, reduces transmission delay, breaks channel congestion deadlock caused by fixed priorities, improves throughput, and uses compensation bits to avoid timing misalignment, ensuring timing determinism.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of controller area network bus communication in data exchange networks, specifically to an intelligent connector communication system based on a CAN bus. Background Technology

[0002] Controller Area Network (CAN) buses, as multi-master serial communication buses, are widely deployed in industrial control and vehicle networks. Their underlying communication rules employ carrier sense multiple access (CSM) and a non-destructive bit-by-bit arbitration mechanism. When multiple nodes simultaneously send messages to the bus, each node listens to the bus level while sending its own arbitration field identifier. If a node detects a discrepancy between the bus level and its own transmitted level, it determines that a higher-priority message is occupying the channel, and the node automatically exits the sending state. The smaller the message identifier value, the higher its priority and the greater the probability of winning bus access. This hardware arbitration mechanism based on static identifiers resolves channel conflicts without a central scheduler, ensuring the real-time transmission of high-priority messages and forming the core operating logic of the existing CAN bus data link layer.

[0003] As the number of network nodes and packet density increase, conventional solutions based on static priority gradually reveal their shortcomings. To alleviate the disadvantage of low-priority packets in channel contention, existing technologies typically employ static time-sharing scheduling or gateway-based traffic splitting. Static time-sharing scheduling allocates fixed transmission time slots to different nodes at the application or network layer, allowing each node to initiate packet transmission only within its assigned time slot. Gateway-based traffic splitting divides a single bus into multiple subnets, using gateway devices to route and forward packets between different subnets. While these two methods formally reduce the number of nodes competing within a single segment, they do not alter the static arbitration attribute of the packets themselves. Time-sharing mechanisms lack adaptive response capabilities to bursty traffic, and allocated idle time slots cannot be reused by other nodes, leading to decreased channel utilization. Gateway forwarding mechanisms introduce additional store-and-forward latency, and the gateway itself can easily become a network bottleneck and a single point of failure.

[0004] When the bus load rate of the existing Controller Area Network (CAN) bus increases, high-priority packets continuously occupy the channel, preventing low-priority packets from winning bit-by-bit arbitration for extended periods. This leads to a sharp increase in transmission delays for low-priority critical control packets, potentially causing starvation and network congestion. Static time-sharing scheduling and gateway traffic splitting schemes do not alter the arbitration rules themselves from the perspective of cross-layer collaboration between the physical and data link layers. They cannot dynamically adjust the competitiveness of low-priority packets based on channel congestion while ensuring the real-time performance of high-priority packets, resulting in starvation of low-priority packets and network congestion under high bus load. Summary of the Invention

[0005] The purpose of this invention is to provide an intelligent connector communication system based on CAN bus, which can effectively solve the problems mentioned in the background art.

[0006] To achieve the above objectives, the technical solution adopted by the present invention is as follows: A smart connector communication system based on CAN bus, the system comprising: The parsing component parses the arbitration field and data field of CAN bus transmit and receive messages in real time, calculates the queuing delay time and bus occupancy rate of low priority frames, and calculates the dynamic delay threshold. The refactoring component intercepts low-priority packets to be sent when the queuing delay time exceeds the dynamic delay threshold and the bus occupancy rate is higher than the saturation threshold. It replaces the identifier of the low-priority packet arbitration field with a pre-stored high-priority virtual identifier and embeds the original identifier of the low-priority packet arbitration field into the data field header using shift encoding. The recovery component, after the replaced message arbitration successfully acquires bus occupancy and before the data field start bit is sent, restores the original identifier in the data field header to the arbitration field, strips the shift code bits in the data field header, and inserts micro-slot compensation bits based on the current bus idle time slot before sending the message.

[0007] Preferably, the process of the parsing component to count the queuing delay time and bus occupancy rate of low-priority frames and calculate the dynamic delay threshold includes: extracting the frame start bit timestamp and data field end bit timestamp from the CAN bus message according to a preset sampling period, calculating the transmission time of a single frame, and calculating the bus occupancy rate by combining the number of standard frames and extended frames observed on the bus per unit time. A corresponding baseline delay coefficient is selected based on the bus occupancy rate range. The weighted sum of the baseline delay coefficient and the single frame transmission time is set as the dynamic delay threshold. The dwell time of the current low-priority message to be sent in the buffer queue is used as the queuing delay time and compared with the dynamic delay threshold.

[0008] Preferably, the process by which the reconstruction component replaces the identifier of the low-priority message arbitration field with a pre-stored high-priority virtual identifier and embeds the original identifier of the low-priority message arbitration field into the data field header by shift encoding includes: querying a preset priority mapping table and obtaining a high-priority virtual identifier that matches the queuing delay time to cover the original identifier field of the low-priority message arbitration field. Perform a circular left shift operation on the original identifier of the low-priority message arbitration field, extract the shift-out bit to generate an additional check bit, concatenate the shift-out bit and the additional check bit to form a shift code, write the shift code to the beginning of the first byte of the low-priority message data field, and shift the original data payload of the data field to the end.

[0009] Preferably, the recovery component restores the original identifier in the data field header to the arbitration field, and the process of stripping the shifted code bits in the data field header includes: after capturing the confirmation signal that the replaced message has obtained bus occupancy rights through non-destructive arbitration, intercepting the message data stream that is about to enter the transmission buffer; The shift code is extracted from the beginning of the first byte of the message data stream data field, and a cyclic right shift operation and additional check bit comparison are performed on the shift code to restore the original identifier; The restored original identifier is overwritten into the identifier field of the message data stream arbitration field, and the shift code is deleted from the beginning of the first byte of the data field. The data payload that was shifted to the next byte is then shifted back to fill the deleted space.

[0010] Preferably, the process of the recovery component inserting micro-slot compensation bits to send a message based on the current bus idle time slot includes: monitoring the duration of the recessive level of the CAN bus level during the inter-frame interval, and mapping the duration of the recessive level to the length of the bus idle time slot; Compare the bus idle time slot length with the nominal compensation duration corresponding to the restored original identifier. If the bus idle time slot length is greater than the nominal compensation duration, insert a micro time slot compensation bit with the same length as the nominal compensation duration before the data field start bit. When the length of the bus idle time slot is less than the nominal compensation duration, the corresponding micro-time slot compensation bits are truncated according to the length of the bus idle time slot and inserted, and the filling bits of the subsequent data field are shortened accordingly.

[0011] Preferably, the process of the parsing component selecting a corresponding reference delay coefficient based on the bus occupancy interval and setting the weighted sum of the reference delay coefficient and the single frame transmission time as the dynamic delay threshold includes: setting multiple consecutive bus occupancy intervals, configuring an independent reference delay coefficient for each bus occupancy interval, and gradually decreasing the corresponding reference delay coefficient as the value of the bus occupancy interval increases. The bus occupancy rate is tracked in real time within the most recent preset number of sampling periods. When the bus occupancy rate crosses the bus occupancy rate range, the reference delay coefficient is switched. The dynamic delay threshold is updated by weighted summation of the switched reference delay coefficient and the single frame transmission time of the current sampling period, so as to shorten the waiting time for low priority frames to trigger priority transition under high load.

[0012] Preferably, the reconstruction component performs a circular left shift operation on the original identifier of the low-priority message arbitration field, extracts the shift-out bit to generate an additional check bit, and concatenates the shift-out bit and the additional check bit to form a shift code. The process includes: identifying the data type of the original identifier as a standard frame 11-bit identifier or an extended frame 29-bit identifier. A first predetermined number of cyclic left shift operations are performed on the 11-bit identifier of the standard frame, and a second predetermined number of cyclic left shift operations are performed on the 29-bit identifier of the extended frame. Extract the overflow bit generated by the circular left shift operation, calculate the parity value of the overflow bit as the additional parity bit, concatenate the overflow bit before the parity value to form the shift code, and add an identifier bit to the beginning of the shift code to distinguish the data type, so as to avoid misjudgment of the identifier length during parsing at the receiving end.

[0013] Preferably, the process by which the recovery component performs a cyclic right shift operation and an additional check bit comparison on the shifted code to restore the original identifier includes: separating the overflow bit and the additional check bit from the extracted shifted code, performing a reverse cyclic right shift operation corresponding to the cyclic left shift operation on the separated overflow bit, and generating a candidate original identifier; Based on the generated candidate original identifier, the parity check value is recalculated, and the recalculated parity check value is compared with the separated additional check bits. If the comparison is inconsistent, it is determined that the shift code was damaged during bus transmission, the current message is discarded and the reconstruction component is triggered to re-execute the shift code and embedding operation of the original identifier; If the comparison matches, the candidate original identifier is confirmed to be the restored original identifier.

[0014] Preferably, the system further includes a receiver parsing component, which is used to monitor the message frame structure at the CAN bus receiver. When a micro-timeslot compensation bit is detected before the start bit of the message data field, the micro-timeslot compensation bit is extracted to measure the actual idle timeslot length, and the sampling point phase of the local bit timer is calibrated using the actual idle timeslot length. The shift code at the beginning of the first byte of the data field is extracted synchronously to restore the original identifier. The restored original identifier is then filled back into the arbitration field identifier field. The micro-slot compensation bit and shift code bit are stripped off and reassembled into a standard message format conforming to the CAN bus protocol. The reassembled standard message format is then submitted to the upper-layer protocol stack of the receiving end to eliminate the intrusive impact of dynamic priority mapping on the parsing logic of the receiving end protocol stack.

[0015] Preferably, the system further includes a multi-node collaboration component, which is used to establish a token passing mechanism among multiple smart connectors deployed in the CAN bus network; When any smart connector triggers low-priority message interception and arbitration field identifier replacement, a bus occupancy request frame containing the local node identifier and the duration of virtual identifier occupation is generated and broadcast to the network. After receiving the bus occupancy request frame, other smart connectors suspend their local arbitration field identifier replacement operation and record the occupancy status of the smart connector that sent the bus occupancy request frame in their locally maintained occupancy status table. When the virtual identifier's occupancy time expires or a confirmation frame is received from the smart connector that sent the bus occupancy request frame to release the occupancy, the corresponding record in the occupancy status table is deleted, and the local arbitration field identifier replacement operation is resumed to avoid multiple smart connectors using the same high-priority virtual identifier at the same time, which could cause bus arbitration conflicts.

[0016] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. By analyzing the arbitration field and data field of Controller Area Network (CAN) bus messages, the queuing delay time and bus occupancy rate of low-priority frames are statistically analyzed. When the queuing delay time exceeds the dynamic delay threshold and the bus occupancy rate is higher than the saturation threshold, the low-priority message to be sent is intercepted. The identifier of the low-priority message's arbitration field is replaced with a pre-stored high-priority virtual identifier, and the original identifier is shift-encoded and embedded into the data field header. This mechanism breaks the technical bias of fixed-priority arbitration, allowing low-priority messages that have been queued for too long to temporarily obtain high-priority status to participate in arbitration and win bus occupancy rights. This suppresses the starvation phenomenon of low-priority messages under high load conditions on the CAN bus and reduces the transmission delay of low-priority critical control messages. By progressively decreasing the base delay coefficient according to the bus occupancy rate interval, the waiting time for triggering priority transitions under high load is shortened, bus channel throughput is improved, and channel congestion deadlock is avoided.

[0017] 2. After the replaced message successfully acquires bus occupancy rights through arbitration and before the data field start bit is sent, the original identifier in the data field header is restored to the arbitration field, the shift-encoded bits are stripped, and micro-slot compensation bits are inserted based on the current bus idle time slot before sending the message. This ensures that the message received by the receiver conforms to the standard protocol format and avoids intrusion into the protocol stack parsing logic. The original identifier is cyclically shifted left and additional check bits are generated. During restoration, a reverse cyclic shift and comparison are performed. If the comparison is inconsistent, the shift encoding is determined to be damaged, and the current message is discarded and the shift encoding embedding operation is re-executed, improving the fault tolerance of the dynamic reconstruction process. The receiver uses micro-slot compensation bits to calibrate the phase of the local bit timer sampling point, ensuring the deterministic nature of communication timing. The multi-node collaborative component uses a token passing mechanism and occupancy status table to postpone the arbitration field identifier replacement operation of other nodes, avoiding arbitration conflicts caused by multiple nodes using the same high-priority virtual identifier simultaneously, and ensuring the stability of the dynamic priority mapping logic in the distributed network. Attached Figure Description

[0018] Figure 1 This is a flowchart illustrating the overall operation of the CAN bus-based intelligent connector communication system of the present invention. Figure 2 This is a flowchart of the parameter statistics and dynamic delay threshold calculation of the analytical component of the present invention; Figure 3 This is a flowchart of the reconstructed component identifier replacement and original identifier shift encoding embedding process of the present invention; Figure 4 This is a flowchart illustrating the process of parsing, verifying, and restoring the original identifier of the recovery component according to the present invention. Figure 5 This is a flowchart of the bus idle time slot detection and micro-time slot compensation bit insertion process of the recovery component of the present invention; Figure 6 This is a flowchart of the token passing and virtual identifier occupancy control process of the multi-node collaborative component of the present invention. Detailed Implementation

[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0020] Please refer to Figure 1This embodiment provides a smart connector communication system based on the CAN bus. The system is deployed between the CAN bus node and the physical bus, operating as a transparent middleware device without altering the existing hardware structure and upper-layer protocol stack implementation of the CAN bus node. By monitoring the bus status and message transmission characteristics in real time, the system dynamically adjusts the arbitration priority of low-priority messages, thus resolving the starvation problem of low-priority messages under high bus load while ensuring the real-time performance of high-priority messages.

[0021] In one embodiment, the system consists of a parsing component, a reconstruction component, and a recovery component. The parsing component is directly connected to the CAN bus physical layer transceiver, capturing all messages transmitted on the bus in real time and extracting the arbitration field and data field information of the messages. Internally, the parsing component maintains a message buffer queue to store low-priority messages to be sent and tracks the dwell time of each message in the queue. Simultaneously, the parsing component continuously calculates the bus occupancy rate as a core indicator for judging bus congestion.

[0022] The reconstruction component connects to the output of the parsing component, receiving bus status parameters and message data to be sent from the parsing component. Internally, the reconstruction component stores a preset set of high-priority virtual identifiers and a priority mapping table. When the queuing delay time of low-priority frames, as calculated by the parsing component, exceeds the dynamic delay threshold, and the bus occupancy rate is higher than the saturation threshold, the reconstruction component triggers a priority reconstruction process. The reconstruction component first intercepts the low-priority message to be sent, selects an unoccupied virtual identifier from the pre-stored set of high-priority virtual identifiers, and overwrites the original identifier field in the message's arbitration field. Subsequently, the reconstruction component performs a shift encoding operation on the original identifier, embedding the encoded original identifier into the header position of the message data field, and shifting the original data payload of the data field forward by the corresponding number of bits.

[0023] The recovery component connects to the output of the reconstruction component and the CAN bus physical layer transceiver, and is responsible for restoring the original frame structure of a message after it has gained bus access. The recovery component continuously monitors the bus arbitration process. When it detects that a replaced message has gained bus access through non-destructive arbitration, it intercepts the message data stream before sending the start bit of the message data field. The recovery component extracts the shift code from the header of the message data field, restores the original identifier through reverse decoding, and rewrites the original identifier into the identifier field of the message arbitration field. Simultaneously, the recovery component strips the shift code bits from the header of the data field and shifts back the data payload that was previously shifted to fill the deleted space. Finally, the recovery component monitors the current idle time slot length of the bus, inserts a micro-time slot compensation bit of appropriate length before the start bit of the data field, and sends the processed message to the CAN bus.

[0024] In this embodiment, the process of the parsing component parsing the arbitration field and data field of CAN bus transceiver messages in real time is as follows: The parsing component samples the bus level through the receive pin of the CAN bus physical layer transceiver at a sampling frequency twice the bus bit rate. When a dominant level transition occurs after 11 consecutive recessive levels, it is determined to be the start of a frame, and the message parsing process is initiated. The parsing component parses the arbitration field, control field, data field, CRC field, and ACK field sequentially according to the frame format specified by the CAN bus protocol. For the arbitration field, the parsing component extracts the identifier field and the remote transmission request bit, and determines whether the message is a standard frame or an extended frame based on the identifier extension bit. For the data field, the parsing component extracts the data length code and the corresponding data payload bytes. The parsing component adds a receive timestamp to each parsed message and stores it in the internal message history buffer.

[0025] The process by which the parsing component calculates the queuing delay time for low-priority frames is as follows: The parsing component internally maintains a first-in, first-out (FIFO) queue of messages to be sent. When the upper application layer submits a message to be sent, the parsing component determines its priority based on the identifier value of the message arbitration field. Messages with identifier values ​​greater than a preset priority threshold are considered low-priority messages and added to the queue. The parsing component records an enqueue timestamp for each message added to the queue and calculates the difference between the current time and the enqueue timestamp in real time as the queuing delay time for that message. For high-priority messages with identifier values ​​less than or equal to the preset priority threshold, the parsing component directly forwards them to the CAN bus physical layer transceiver for transmission, without entering the queue.

[0026] The process of the parsing component calculating bus occupancy is as follows: The parsing component statistically analyzes the bus status according to a preset sampling period. Within each sampling period, the parsing component records the ratio of the total duration of the bus being at a dominant level to the total duration of the sampling period, which is taken as the bus occupancy rate for that sampling period. Simultaneously, the parsing component counts the number of standard frames and extended frames observed on the bus per unit time, calculates the average frame length and average frame interval, and uses these to assist in assessing the bus load status. The parsing component compares the calculated bus occupancy rate with a preset saturation threshold. When the bus occupancy rate exceeds the saturation threshold for multiple consecutive sampling periods, the bus is determined to have entered a high-load state.

[0027] The process of the reconstruction component intercepting low-priority packets to be sent is as follows: The reconstruction component receives the queuing delay time and bus occupancy parameters output by the parsing component in real time. When the queuing delay time exceeds the dynamic delay threshold and the bus occupancy rate is higher than the saturation threshold, the reconstruction component sends an interception command to the parsing component. After receiving the interception command, the parsing component suspends the forwarding of packets in the packet buffer queue to the CAN bus physical layer transceiver and transmits the low-priority packets at the head of the queue to the internal buffer of the reconstruction component. The reconstruction component performs priority reconstruction processing on the packet, and after processing, transmits the packet to the recovery component.

[0028] The process by which the refactoring component replaces the identifier of a low-priority message arbitration field with a pre-stored high-priority virtual identifier is as follows: The refactoring component internally stores a set of high-priority virtual identifiers. All identifiers in this set have values ​​less than a preset priority threshold and therefore higher arbitration priority. The refactoring component maintains a virtual identifier occupancy status table, recording the current occupancy status and occupancy node identifier for each virtual identifier. When it is necessary to replace the identifier of a low-priority message, the refactoring component queries the virtual identifier occupancy status table and selects a high-priority virtual identifier that is currently idle. The refactoring component writes the selected virtual identifier into the identifier field of the message arbitration field, overwriting the original identifier, and marks the virtual identifier as occupied in the virtual identifier occupancy status table.

[0029] The process by which the reconstruction component embeds the shift-encoded original identifier of the low-priority message arbitration field into the data field header is as follows: The reconstruction component extracts the original identifier of the message arbitration field and performs a circular left shift operation on it. The number of bits for the circular left shift is determined according to the length of the original identifier; for a standard frame with an 11-bit identifier, the circular left shift is 3 bits; for an extended frame with a 29-bit identifier, the circular left shift is 5 bits. The reconstruction component extracts the overflow bit generated by the circular left shift operation and calculates the parity value of the overflow bit as an additional parity bit. The reconstruction component concatenates the overflow bit and the additional parity bit to form a shift code and adds a 1-bit flag bit to the header of the shift code to distinguish between standard frames and extended frames. The reconstruction component writes the generated shift code to the beginning of the first byte of the message data field and shifts the original data payload of the data field forward by a number of bits equal to the length of the shift code. At the same time, the reconstruction component updates the data length code in the message control field, increasing the data length by a number of bytes equal to the length of the shift code.

[0030] The process by which the recovery component intercepts the message data stream after successfully acquiring bus access through arbitration and before the start bit of the data field is transmitted is as follows: The recovery component continuously monitors the CAN bus arbitration process. After the reconstruction component submits the replaced message to the transmit buffer, the recovery component synchronously monitors the bus level status. During the message transmission arbitration field, the recovery component compares the transmitted level with the actual level on the bus bit by bit. When all bits of the arbitration field have been transmitted and no level conflict is detected, the recovery component determines that the message has acquired bus access through non-destructive arbitration. At this point, the recovery component sends a pause transmission command to the CAN bus controller, intercepts the message data stream about to enter the transmit shift register, and pauses the transmission of the data field.

[0031] The process by which the recovery component restores the original identifier from the data field header to the arbitration field is as follows: The recovery component extracts the first byte of the data field from the intercepted message data stream and extracts the shift code from the beginning of that byte. First, the recovery component determines whether the original identifier is a standard frame 11-bit identifier or an extended frame 29-bit identifier based on the flag bits in the shift code header. Then, the recovery component separates the overflow bit and the additional parity bit from the shift code, performs a reverse circular right shift operation corresponding to the circular left shift operation on the overflow bit, and generates a candidate original identifier. The recovery component recalculates the parity value based on the candidate original identifier and compares the recalculated parity value with the separated additional parity bit. If the comparison matches, the recovery component overwrites the candidate original identifier into the identifier field of the message data stream arbitration field.

[0032] The process of the recovery component stripping the shift-coded bits from the data field header is as follows: After confirming that the candidate original identifier is the correct original identifier, the recovery component deletes the corresponding shift-coded bits from the data field of the message data stream. The recovery component then shifts the data payload back by a number of bits equal to the shift-coded length to fill the space left after deleting the shift-coded bits. Simultaneously, the recovery component updates the data length code in the message control field, reducing the data length by a number of bytes equal to the shift-coded length, ensuring that the data length code matches the actual data payload length.

[0033] The process of the recovery component inserting micro-timeslot compensation bits to send messages based on the current bus idle timeslot is as follows: The recovery component monitors the duration of the recessive level of the CAN bus during the inter-frame interval and maps this duration to the bus idle timeslot length. The recovery component internally stores a nominal compensation duration mapping table, which records the nominal compensation duration corresponding to different original identifiers. The recovery component queries the nominal compensation duration mapping table based on the restored original identifier to obtain the corresponding nominal compensation duration. The recovery component compares the bus idle timeslot length with the nominal compensation duration. When the bus idle timeslot length is greater than the nominal compensation duration, a micro-timeslot compensation bit of the same length as the nominal compensation duration is inserted before the start bit of the data field. When the bus idle timeslot length is less than the nominal compensation duration, the corresponding micro-timeslot compensation bit is truncated according to the bus idle timeslot length and inserted, and the subsequent data field padding bits are shortened accordingly. The recovery component submits the message data stream after inserting the micro-timeslot compensation bits to the transmit shift register of the CAN bus controller, thus resuming the message transmission process.

[0034] In this embodiment, the overall system workflow is as follows: The parsing component parses CAN bus transmit and receive messages in real time, and calculates the queuing delay time and bus occupancy rate of low-priority frames. When the queuing delay time exceeds the dynamic delay threshold and the bus occupancy rate is higher than the saturation threshold, the reconstruction component intercepts the low-priority message to be sent, replaces its arbitration field identifier with a high-priority virtual identifier, and embeds the original identifier in the data field header using shift encoding. The replaced message participates in bus arbitration, and due to its high priority, it can quickly win bus occupancy. After successful message arbitration and before the data field start bit is sent, the recovery component intercepts the message data stream, restores the original identifier in the data field header to the arbitration field, strips the shift encoded bits, and inserts micro-timeslot compensation bits based on the current bus idle time slot. Finally, the recovery component sends the processed message to the CAN bus. After receiving the message, the receiving node parses it according to the standard CAN bus protocol without modifying the upper-layer protocol stack. The system behavior under different bus load conditions is compared in Table 1.

[0035] Table 1 Comparison of system behavior under different bus load conditions

[0036] As shown in Table 1, the system adopts different processing strategies based on different bus load states. Under low load, bus resources are sufficient, and low-priority packets can win arbitration normally. The system directly sends packets without priority reconfiguration, avoiding unnecessary processing delays. Under medium load, although the bus occupancy rate is higher than the saturation threshold, the queuing delay time of low-priority packets has not yet exceeded the dynamic delay threshold. The system continues to monitor the bus status and does not trigger priority reconfiguration for the time being. Under high load, the queuing delay time of low-priority packets exceeds the dynamic delay threshold, and the system triggers the priority reconfiguration process, allowing low-priority packets to temporarily obtain high-priority status to participate in arbitration. Under extremely high load, the bus is close to saturation, and the queuing delay time of low-priority packets increases sharply. The system continuously triggers priority reconfiguration, prioritizing the packets with the longest queuing time to prevent starvation of low-priority packets.

[0037] In a preferred embodiment, reference Figure 2 The parsing component extracts the frame start timestamp and data field end timestamp from the CAN bus message according to a preset sampling period, calculates the transmission time of a single frame, and calculates the bus occupancy rate by combining the number of standard frames and extended frames observed on the bus per unit time. The parsing component selects the corresponding baseline delay coefficient based on the bus occupancy rate interval, sets the weighted sum of the baseline delay coefficient and the transmission time of a single frame as the dynamic delay threshold, and compares the dwell time of the currently pending low-priority message in the buffer queue as the queuing delay time with the dynamic delay threshold.

[0038] In this embodiment, the process of the parsing component extracting the frame start bit timestamp and data field end bit timestamp is as follows: The parsing component is internally configured with a high-precision timer, and the timer's clock frequency is 100 times the bus bit rate. When the parsing component detects a dominant level transition of the frame start bit, it immediately captures the current timer count value as the frame start bit timestamp of the message. When the parsing component parses the last bit of the data field, it captures the current timer count value again as the data field end bit timestamp of the message. The parsing component calculates the difference between the data field end bit timestamp and the frame start bit timestamp, multiplies it by the timer's clock period, and obtains the single-frame transmission time of the message.

[0039] The process by which the parsing component calculates the bus occupancy rate is as follows: Within each preset sampling period, the parsing component sums the single-frame transmission times of all observed packets, divides this sum by the total duration of the sampling period, and obtains the bus occupancy rate for that sampling period. The formula for calculating the bus occupancy rate is: ;

[0040] in, Bus utilization rate This represents the total number of messages observed within the sampling period. For the first The transmission time of a single frame of a message. This represents the total duration of the sampling period.

[0041] The parsing component simultaneously counts the number of standard frames observed on the bus per unit time. With the number of extended frames Calculate the average frame length : ;

[0042] in, The average length of a standard frame. The average frame length is used to help assess bus load status. When the average frame length increases, the same number of packets will occupy more bus resources, and the bus utilization rate will increase accordingly.

[0043] The process by which the parsing component selects the corresponding reference delay coefficient based on the bus occupancy range is as follows: The parsing component internally presets multiple consecutive bus occupancy ranges, each configured with an independent reference delay coefficient. As the bus occupancy range value increases, the corresponding reference delay coefficient decreases progressively. For example, the parsing component presets four bus occupancy ranges: 0%-30%, 30%-60%, 60%-90%, and 90%-100%, with corresponding reference delay coefficients of 5.0, 3.0, 1.5, and 0.8, respectively. The parsing component calculates the bus occupancy rate of the current sampling period in real time, determines its corresponding range, and selects the appropriate reference delay coefficient.

[0044] The process by which the parsing component sets the weighted sum of the baseline delay coefficient and the single-frame transmission time as the dynamic delay threshold is as follows: The parsing component calculates the average single-frame transmission time within the most recent preset number of sampling periods. The reference delay factor Average single-frame transmission time Multiply to obtain the dynamic delay threshold. : ;

[0045] The parsing component uses the dwell time of currently pending low-priority packets in the buffer queue as the queuing delay time. , and dynamic delay threshold Perform a comparison. When If the queuing delay time of the message is too long, the priority reconstruction process needs to be triggered.

[0046] Furthermore, the parsing component tracks the bus occupancy rate in real time within the most recent preset number of sampling periods. When the bus occupancy rate crosses a certain range, it triggers a switch in the baseline latency coefficient. The parsing component then performs a weighted summation calculation based on the switched baseline latency coefficient and the single-frame transmission time of the current sampling period to update the dynamic latency threshold. For example, when the bus occupancy rate rises from the 30%-60% range to the 60%-90% range, the baseline latency coefficient switches from 3.0 to 1.5, and the dynamic latency threshold decreases accordingly, shortening the waiting time for low-priority frames to trigger priority transitions under high load.

[0047] In this embodiment, the dynamic latency threshold can be adaptively adjusted according to the bus load status. Under low load conditions, the baseline latency coefficient is larger, and the dynamic latency threshold is higher. Low-priority packets need to wait a longer time before triggering priority reconfiguration, avoiding frequent priority switching that could affect system stability. Under high load conditions, the baseline latency coefficient is smaller, and the dynamic latency threshold is lower. Low-priority packets can quickly trigger priority reconfiguration, gain bus occupancy, and prevent starvation. The baseline latency coefficient and dynamic latency threshold corresponding to different bus occupancy ranges are shown in Table 2.

[0048] Table 2. Baseline delay coefficient and dynamic delay threshold corresponding to different bus utilization ranges.

[0049] As shown in Table 2, the baseline latency coefficient decreases progressively with increasing bus occupancy. Although the average single-frame transmission time increases, the dynamic latency threshold generally shows a downward trend. Under extremely high load conditions with bus occupancy of 90%-100%, the dynamic latency threshold is only 144μs. Low-priority packets will trigger priority reconstruction if they remain in the buffer queue for more than 144μs, which can effectively suppress the starvation phenomenon of low-priority packets.

[0050] In a preferred embodiment, reference Figure 3 The reconstruction component queries the preset priority mapping table to obtain a high-priority virtual identifier that matches the queuing delay time, which then overwrites the original identifier field of the low-priority message arbitration field. The reconstruction component performs a circular left shift operation on the original identifier of the low-priority message arbitration field, extracts the shift-out bit to generate an additional parity bit, concatenates the shift-out bit and the additional parity bit to form a shift code, writes the shift code to the beginning of the first byte of the low-priority message data field, and shifts the original data payload of the data field sequentially to the end.

[0051] In this embodiment, the process by which the reconstruction component queries a preset priority mapping table to obtain a high-priority virtual identifier is as follows: The reconstruction component internally stores a priority mapping table, which divides the queuing delay time into multiple intervals, each interval corresponding to a virtual identifier of a different priority. The longer the queuing delay time, the higher the priority of the corresponding virtual identifier. For example, the priority mapping table divides the queuing delay time into three intervals: 0-200μs, 200-500μs, and above 500μs, with corresponding virtual identifiers of 0x010, 0x008, and 0x004, respectively. The reconstruction component queries the priority mapping table based on the queuing delay time of the low-priority message to be sent to obtain the corresponding high-priority virtual identifier.

[0052] The process of the reconstruction component performing a circular left shift operation on the original identifier is as follows: The reconstruction component first identifies the data type of the original identifier as either a standard frame 11-bit identifier or an extended frame 29-bit identifier. For a standard frame 11-bit identifier, the reconstruction component performs a 3-bit circular left shift operation; for an extended frame 29-bit identifier, the reconstruction component performs a 5-bit circular left shift operation. The mathematical expression for the circular left shift operation is: For the standard frame 11-bit identifier: ;

[0053] For the extended frame 29-bit identifier: ;

[0054] in, It is a left shift operator. This is the right shift operator. For bitwise OR operator, The original 11-bit identifier after recovery. The original 29-bit identifier after recovery. It is the received, shift-encoded 11-bit intermediate identifier. It is the received, shift-encoded 29-bit intermediate identifier. The circular left shift operation shifts the high-order bits of the identifier out and pads them to the low-order bits, preserving all the information of the identifier and facilitating subsequent reverse recovery.

[0055] The process of the reconstruction component extracting the shift-out bits to generate additional parity bits is as follows: The reconstruction component extracts the overflow bits generated by the circular left shift operation. For a standard frame with an 11-bit identifier, the overflow bits are the highest 3 bits of the identifier; for an extended frame with a 29-bit identifier, the overflow bits are the highest 5 bits of the identifier. The reconstruction component calculates the parity value of the overflow bits as the additional parity bits. The formula for calculating the parity value is: ;

[0056] in, This is the parity check value. The overflow bit Bit, This is the XOR operator. The parity value is 1 when the number of 1s in the overflow bit is odd, and 0 when the number of 1s in the overflow bit is even.

[0057] The process by which the reconstruction component concatenates the shift-out bits and the additional parity bits to form the shift code is as follows: The reconstruction component adds a 1-bit flag bit to the beginning of the shift code to distinguish between standard frames and extended frames. A flag bit of 0 indicates a standard frame, and a flag bit of 1 indicates an extended frame. The reconstruction component then concatenates the flag bit, overflow bits, and additional parity bits sequentially to form the complete shift code. For a standard frame, the total length of the shift code is 5 bits, including 1 flag bit, 3 overflow bits, and 1 parity bit; for an extended frame, the total length of the shift code is 7 bits, including 1 flag bit, 5 overflow bits, and 1 parity bit.

[0058] The process by which the reconstruction component writes the shift code into the data field header and shifts the data payload forward is as follows: The reconstruction component writes the generated shift code before the most significant bit of the first byte of the message data field. For example, for a 5-bit standard frame shift code, it writes bits 7 to 3 of the first byte. The reconstruction component then shifts the original data payload of the data field forward by a number of bits equal to the length of the shift code, filling the low-order space left after the shift code is written. Simultaneously, the reconstruction component updates the data length code in the message control field, increasing the data length by 1 byte to accommodate the shift code.

[0059] In this embodiment, through a cyclic left shift operation and the generation of an additional parity bit, all information of the original identifier is encoded into the shift code, which has a certain degree of fault tolerance. In the subsequent recovery process, by comparing the reverse cyclic right shift operation with the parity bit, the original identifier can be accurately restored, and potential bit errors during transmission can be detected. A comparison of the shift coding structures of the standard frame and the extended frame is shown in Table 3.

[0060] Table 3 Comparison of shift coding structures between standard frames and extended frames

[0061] As shown in Table 3, the shift coding structures of standard frames and extended frames are slightly different, but both include three parts: a flag bit, an overflow bit, and a check bit. The total length of the shift code does not exceed 1 byte, so only the data length code needs to be increased by 1 byte to accommodate it, which will not significantly increase the transmission overhead of the message.

[0062] In a preferred embodiment, reference Figure 4After capturing the confirmation signal indicating that the replaced message has obtained bus access through non-destructive arbitration, the recovery component intercepts the message data stream about to enter the transmit buffer. The recovery component extracts the shift code from the beginning of the first byte of the message data stream's data field, performs a cyclic right shift operation on the shift code, and compares it with an additional parity bit to restore the original identifier. The recovery component overwrites the restored original identifier into the identifier field of the message data stream's arbitration field, simultaneously deleting the shift code from the beginning of the first byte of the data field and shifting the subsequently shifted data payload back to fill the deleted space.

[0063] In this embodiment, the process by which the recovery component captures the confirmation signal indicating that the message has obtained bus access through non-destructive arbitration is as follows: The recovery component is connected to the arbitration logic unit of the CAN bus controller and monitors level conflict signals during the arbitration process in real time. When a message transmits each bit of the arbitration field, the CAN bus controller compares the transmitted level with the actual level on the bus. If the two are inconsistent, the controller generates a level conflict signal, indicating that the arbitration for that bit has failed. The recovery component continuously listens for level conflict signals. When all bits of the arbitration field have been transmitted and no level conflict signal has been detected, the recovery component determines that the message has obtained bus access through non-destructive arbitration and generates an arbitration success confirmation signal.

[0064] The process by which the recovery component intercepts the message data stream about to enter the transmit buffer is as follows: After receiving the successful arbitration confirmation signal, the recovery component immediately sends a pause transmission command to the CAN bus controller. Upon receiving the pause transmission command, the CAN bus controller stops loading message data from the transmit buffer into the transmit shift register. At this point, the arbitration field has been transmitted successfully, but the data field has not yet started transmitting. The recovery component reads the complete message data stream from the CAN bus controller's transmit buffer, including the arbitration field, control field, and data field, and performs subsequent recovery processing.

[0065] The process by which the recovery component extracts the shift code from the beginning of the first byte of the data field in the message data stream is as follows: First, the recovery component reads the data length code in the message control field to determine the length of the data field. Then, the recovery component reads the first byte of the data field and determines the type of shift code based on the highest bit (the flag bit) of that byte. If the flag bit is 0, it indicates a standard frame shift code, and bits 7 to 3 (5 bits in total) of that byte are extracted as the shift code. If the flag bit is 1, it indicates an extended frame shift code, and bits 7 to 1 (7 bits in total) of that byte are extracted as the shift code.

[0066] The process by which the recovery component performs a cyclic right shift operation on the shifted code and compares the additional parity bits to restore the original identifier is as follows: The recovery component separates the flag bit, overflow bit, and additional parity bit from the extracted shifted code. For a standard frame, 1 flag bit, 3 overflow bits, and 1 additional parity bit are separated; for an extended frame, 1 flag bit, 5 overflow bits, and 1 additional parity bit are separated. The recovery component performs a reverse cyclic right shift operation on the overflow bits, corresponding to the cyclic left shift operation, to generate candidate original identifiers. The mathematical expression for the cyclic right shift operation is: For the standard frame 11-bit identifier: ;

[0067] For the extended frame 29-bit identifier: ;

[0068] in, This indicates an overflow bit. The recovery component recalculates the parity value based on the generated candidate original identifier and compares the recalculated parity value with the separated additional parity bit. If the comparison is inconsistent, the recovery component determines that the shift code was corrupted during bus transmission, discards the current message, and sends a retransmission request to the reconstruction component, triggering the reconstruction component to re-execute the shift code and embedding operation of the original identifier. If the comparison is consistent, the recovery component confirms that the candidate original identifier is the correct original identifier.

[0069] The process by which the recovery component overwrites the original identifier into the arbitration field and strips the shift code is as follows: The recovery component overwrites the identifier field of the message data stream arbitration field with the restored original identifier, replacing the previous high-priority virtual identifier. Simultaneously, the recovery component removes the bit corresponding to the shift code from the first byte of the data field, shifts the subsequently shifted data payload back by a number of bits equal to the shift code length, filling the space left after deleting the shift code. The recovery component updates the data length code in the message control field, reducing the data length by 1 byte to ensure the data length code matches the actual data payload length.

[0070] In this embodiment, by comparing the reverse circular right shift operation with the additional parity bit, the original identifier can be accurately restored, and potential bit errors during transmission can be detected. If a bit flip occurs during transmission of the shift code, the parity check comparison will fail, and the recovery component will discard the current message and request a retransmission to prevent erroneous identifiers from being written into the arbitration field, which could lead to parsing errors at the receiving end.

[0071] In a preferred embodiment, reference Figure 5The recovery component monitors the duration of the recessive level of the CAN bus during the inter-frame interval and maps this duration to the bus idle time slot length. The recovery component compares the bus idle time slot length with the nominal compensation duration corresponding to the restored original identifier. When the bus idle time slot length is greater than the nominal compensation duration, a micro-time slot compensation bit of equal length to the nominal compensation duration is inserted before the start bit of the data field. When the bus idle time slot length is less than the nominal compensation duration, the corresponding micro-time slot compensation bit is truncated according to the bus idle time slot length and inserted, and the subsequent data field padding bits are shortened accordingly.

[0072] In this embodiment, the process of the recovery component monitoring the bus idle time slot length is as follows: After successful message arbitration, the recovery component continuously monitors the CAN bus level. When the last bit of the arbitration field is transmitted, the bus enters the inter-frame interval stage, at which time the bus level is recessive. The recovery component starts a high-precision timer to record the duration of the recessive level. When a dominant level transition is detected or the timer count reaches the maximum inter-frame interval, the timing stops, and the recorded recessive level duration is taken as the bus idle time slot length.

[0073] The process by which the recovery component obtains the nominal compensation duration corresponding to the original identifier is as follows: The recovery component internally stores a nominal compensation duration mapping table, which records the nominal compensation duration corresponding to different original identifiers. The nominal compensation duration is determined based on the priority of the original identifier; the lower the priority of the identifier, the longer the nominal compensation duration. For example, the nominal compensation duration corresponding to the original identifier 0x7FF (lowest priority) is 10μs, the nominal compensation duration corresponding to the original identifier 0x400 is 5μs, and the nominal compensation duration corresponding to the original identifier 0x100 is 2μs. The recovery component queries the nominal compensation duration mapping table based on the restored original identifier to obtain the corresponding nominal compensation duration. .

[0074] The process of the recovery component inserting the micro-timeslot compensation bit is as follows: the recovery component compares the bus idle timeslot length. Compensation duration .when At that time, the recovery component inserts a value before the start position of the data field. Equal-length micro-timeslot compensation bits. Each micro-timeslot compensation bit consists of a continuous recessive level, and its length is equal to the nominal compensation duration. When At that time, the recovery component follows The length of the data field is truncated to the corresponding micro-slot compensation bits for insertion, and the subsequent data field padding bits are shortened accordingly. The shortened padding bit length is equal to the difference between the nominal compensation duration and the bus idle slot length, i.e. .

[0075] In this embodiment, the purpose of inserting micro-slot compensation bits is to compensate for the message transmission timing offset caused by priority reconstruction. Since the replaced message has a higher priority, it will acquire bus access earlier than the original message, resulting in an earlier message transmission time. Inserting micro-slot compensation bits can delay the message transmission time by an appropriate amount, ensuring that the time the receiver receives the message matches the expected transmission time of the original message, thus guaranteeing the determinism of communication timing.

[0076] In a preferred embodiment, the system further includes a receiver parsing component. The receiver parsing component is deployed between the CAN bus receiver node and the physical bus, and is used to monitor the message frame structure at the CAN bus receiver. When a micro-slot compensation bit is detected before the start bit of the message data field, the receiver parsing component extracts the micro-slot compensation bit, measures the actual idle time slot length, and uses the actual idle time slot length to calibrate the sampling point phase of the local bit timer. The receiver parsing component synchronously extracts the shift code at the beginning of the first byte of the data field to restore the original identifier, fills the restored original identifier back into the arbitration field identifier field, strips the micro-slot compensation bit and shift code bit, reassembles it into a standard message format conforming to the CAN bus protocol, and submits the reassembled standard message format to the receiver's upper-layer protocol stack.

[0077] In this embodiment, the process of the receiving end parsing component monitoring the message frame structure is as follows: the receiving end parsing component samples the bus level at a sampling frequency twice that of the bus bit rate to monitor the bus status in real time. When the start-of-frame bit is detected, the receiving end parsing component parses the message according to the standard CAN bus protocol format. After parsing the arbitration field and control field, the receiving end parsing component monitors the position of the start-of-data field bit. If a continuous recessive level is detected at the expected start-of-data field bit position, and the duration of the recessive level is within the preset micro-timeslot compensation bit length range, the receiving end parsing component determines that the message contains a micro-timeslot compensation bit.

[0078] The process by which the receiver's parsing component extracts the micro-timeslot compensation bit to calibrate the phase of the local bit timer sampling point is as follows: The receiver's parsing component measures the actual length of the micro-timeslot compensation bit and uses it as the actual idle timeslot length. The receiver's parsing component calculates the actual idle time slot length and the nominal compensation duration. The difference : ;

[0079] The receiving end parsing component uses the difference Adjust the sampling point phase of the local bit timer. If This indicates that the actual idle time slot length is greater than the nominal compensation time, and the sampling point phase needs to be adjusted backward. ;if This indicates that the actual idle time slot length is less than the nominal compensation time, and the sampling point phase needs to be adjusted forward. By calibrating the sampling point phase, sampling point offsets caused by bus transmission delays and node clock drift can be eliminated, ensuring communication reliability.

[0080] The process of the receiving end parsing component extracting the shift code to restore the original identifier is as follows: After recognizing the micro-timeslot compensation bit, the receiving end parsing component skips the micro-timeslot compensation bit and begins parsing the data field. The receiving end parsing component reads the first byte of the data field and extracts the shift code from the beginning of this byte. Following the same method as the transmitting end recovery component, the receiving end parsing component performs a cyclic right shift operation on the shift code and adds a check bit comparison to restore the original identifier.

[0081] The process of the receiving end parsing component reconstructing the standard message format is as follows: The receiving end parsing component fills the reconstructed original identifier back into the identifier field of the message arbitration field, replacing the previous high-priority virtual identifier. Simultaneously, the receiving end parsing component strips the shift-coded bits from the message data field header, shifts the subsequently shifted data payload back to fill the deleted space, and updates the data length code in the message control field. The receiving end parsing component also strips the micro-slot compensation bits before the start bit of the message data field, ensuring that the message frame structure fully conforms to the standard CAN bus protocol format. Finally, the receiving end parsing component submits the reconstructed standard message to the receiving end upper-layer protocol stack for processing.

[0082] In this embodiment, the receiver parsing component can automatically identify and process messages that have undergone priority reconstruction, restoring them to the standard CAN bus protocol format. The upper-layer protocol stack of the receiver does not need to be modified to parse and process these messages normally, eliminating the intrusive impact of dynamic priority mapping on the receiver protocol stack parsing logic.

[0083] In a preferred embodiment, reference Figure 6 The system also includes a multi-node collaboration component. Deployed in each smart connector, this component establishes a token passing mechanism among multiple smart connectors deployed in the CAN bus network. When any smart connector triggers low-priority message interception and arbitration field identifier replacement, it generates a bus occupancy request frame containing the local node identifier and the duration of virtual identifier occupancy, and broadcasts it to the network. Upon receiving the bus occupancy request frame, other smart connectors suspend their local arbitration field identifier replacement operation and record the occupancy status of the smart connector that sent the bus occupancy request frame in their locally maintained occupancy status table. When the virtual identifier occupancy duration expires or an acknowledgment frame confirming the release of occupancy from the smart connector that sent the bus occupancy request frame is received, the corresponding record in the occupancy status table is deleted, and the local arbitration field identifier replacement operation resumes.

[0084] In this embodiment, the process of establishing a token passing mechanism by the multi-node collaborative components is as follows: During the CAN bus network initialization phase, all smart connectors' multi-node collaborative components broadcast a node discovery frame, declaring their existence and node identifier. The multi-node collaborative components determine the initial token holder based on the size of the node identifier, with the smart connector having the smallest node identifier becoming the initial token holder. The token holder has the right to use the higher-priority virtual identifier, and other smart connectors must not trigger the priority reconstruction process before obtaining the token. After completing the priority reconstruction operation, the token holder passes the token to the next smart connector with the next node identifier.

[0085] When any smart connector triggers low-priority message interception and arbitration field identifier replacement, the multi-node collaborative component generates a bus occupancy request frame. The bus occupancy request frame includes the local node identifier, the requested virtual identifier, and the duration of the virtual identifier occupancy. The multi-node collaborative component broadcasts the bus occupancy request frame throughout the entire CAN bus network.

[0086] Upon receiving a bus occupancy request frame, other smart connectors check their local occupancy status table. If the requested virtual identifier is not already in use, the multi-node collaborative component suspends its local arbitration field identifier replacement operation and records the node identifier of the smart connector that sent the bus occupancy request frame, the occupied virtual identifier, and the occupancy duration in the occupancy status table. If the requested virtual identifier is already in use, the multi-node collaborative component sends a rejection frame to the smart connector that sent the bus occupancy request frame, indicating that the virtual identifier is unavailable.

[0087] When the virtual identifier's usage time expires, the multi-node collaborative component of the smart connector holding the virtual identifier automatically releases it and broadcasts a usage release confirmation frame. Upon receiving the confirmation frame, other smart connectors delete the corresponding record from their local usage status table and resume their local arbitration field identifier replacement operation. If the smart connector holding the virtual identifier completes message transmission before the usage time expires, it can also broadcast a usage release confirmation frame in advance to release the virtual identifier.

[0088] In this embodiment, the token passing mechanism and occupancy status table ensure that only one smart connector uses a high-priority virtual identifier at a time, avoiding bus arbitration conflicts caused by multiple smart connectors using the same high-priority virtual identifier simultaneously. This guarantees the stability and reliability of the dynamic priority mapping logic in the distributed CAN bus network. The frame types and formats of the multi-node collaborative components are shown in Table 4.

[0089] Table 4 Frame Types and Formats of Multi-Node Collaborative Components

[0090] As shown in Table 4, the multi-node collaborative component uses five different types of frames for communication, each with a fixed identifier and data field format. These frame identifiers are all in the high-priority range, enabling rapid transmission under high bus load conditions and ensuring the real-time performance of the multi-node collaborative mechanism.

[0091] In one embodiment, the system workflow is as follows: The parsing component parses CAN bus transmit and receive messages in real time, and calculates the queuing delay time and bus occupancy rate of low-priority frames. When the queuing delay time exceeds the dynamic delay threshold and the bus occupancy rate is higher than the saturation threshold, the multi-node collaborative component checks whether it has a token locally or whether the requested virtual identifier is available. If available, the reconstruction component intercepts the low-priority message to be sent, replaces its arbitration field identifier with a high-priority virtual identifier, and embeds the original identifier in the data field header with shift encoding. The multi-node collaborative component broadcasts a bus occupancy request frame to notify other smart connectors to postpone the priority reconstruction operation. The replaced message participates in bus arbitration. After winning bus occupancy, the recovery component intercepts the message data stream, restores the original identifier in the data field header to the arbitration field, strips the shift encoding bits, and inserts micro-timeslot compensation bits. The recovery component sends the processed message to the CAN bus. After the message is sent, the multi-node collaborative component broadcasts an occupancy release confirmation frame to release the virtual identifier. After receiving the message, the receiving end parsing component extracts the phase of the micro-slot compensation bit to calibrate the sampling point, extracts the shift code to restore the original identifier, and reassembles it into a standard message format to submit to the upper-layer protocol stack.

[0092] This technical solution utilizes a parsing component to monitor bus status and message transmission characteristics in real time, a reconstruction component to dynamically adjust the arbitration priority of low-priority messages, and a recovery component to restore the original frame structure of a message after it gains bus access, thus overcoming the technical bias of fixed-priority arbitration. This invention effectively suppresses low-priority message starvation under high load conditions on the CAN bus while ensuring the real-time performance of high-priority messages, reducing the transmission delay of low-priority critical control messages. Simultaneously, through the receiver parsing component and multi-node collaborative components, it ensures system compatibility with existing protocol stacks and stability in distributed networks.

Claims

1. A smart connector communication system based on CAN bus, characterized in that, The system includes: The parsing component parses the arbitration field and data field of CAN bus transmit and receive messages in real time, calculates the queuing delay time and bus occupancy rate of low priority frames, and calculates the dynamic delay threshold. The refactoring component intercepts low-priority packets to be sent when the queuing delay time exceeds the dynamic delay threshold and the bus occupancy rate is higher than the saturation threshold. It replaces the identifier of the low-priority packet arbitration field with a pre-stored high-priority virtual identifier and embeds the original identifier of the low-priority packet arbitration field into the data field header using shift encoding. The recovery component restores the original identifier in the data field header to the arbitration field after the replacement message arbitration successfully acquires bus occupancy and before the data field start bit is sent. It also strips the shift-encoded bits in the data field header and inserts micro-slot compensation bits based on the current bus idle time slot before sending the message.

2. The intelligent connector communication system based on CAN bus according to claim 1, characterized in that, The process of parsing components to statistically analyze the queuing delay time and bus occupancy rate of low-priority frames and calculate the dynamic delay threshold includes: extracting the frame start bit timestamp and data field end bit timestamp from the CAN bus message according to a preset sampling period, calculating the transmission time of a single frame, and calculating the bus occupancy rate by combining the number of standard frames and extended frames observed on the bus per unit time. A corresponding baseline delay coefficient is selected based on the bus occupancy rate range. The weighted sum of the baseline delay coefficient and the single frame transmission time is set as the dynamic delay threshold. The dwell time of the current low-priority message to be sent in the buffer queue is used as the queuing delay time and compared with the dynamic delay threshold.

3. The intelligent connector communication system based on CAN bus according to claim 1, characterized in that, The process by which the reconstruction component replaces the identifier of the low-priority message arbitration field with a pre-stored high-priority virtual identifier and embeds the original identifier of the low-priority message arbitration field into the data field header by shift encoding includes: querying a preset priority mapping table and obtaining a high-priority virtual identifier that matches the queuing delay time to cover the original identifier field of the low-priority message arbitration field. Perform a circular left shift operation on the original identifier of the low-priority message arbitration field, extract the shift-out bit to generate an additional check bit, concatenate the shift-out bit and the additional check bit to form a shift code, write the shift code to the beginning of the first byte of the low-priority message data field, and shift the original data payload of the data field to the end.

4. The intelligent connector communication system based on CAN bus according to claim 1, characterized in that, The recovery component restores the original identifier in the data field header to the arbitration field. The process of stripping the shifted coded bits in the data field header includes: after capturing the confirmation signal that the replaced message has obtained bus occupancy rights through non-destructive arbitration, intercepting the message data stream that is about to enter the transmission buffer. The shift code is extracted from the beginning of the first byte of the message data stream data field, and a cyclic right shift operation and additional check bit comparison are performed on the shift code to restore the original identifier; The restored original identifier is overwritten into the identifier field of the message data stream arbitration field, and the shift code is deleted from the beginning of the first byte of the data field. The data payload that was shifted to the next byte is then shifted back to fill the deleted space.

5. The intelligent connector communication system based on CAN bus according to claim 1, characterized in that, The process of the recovery component inserting micro-slot compensation bits to send messages based on the current bus idle time slot includes: monitoring the duration of the recessive level of the CAN bus level during the inter-frame interval, and mapping the duration of the recessive level to the bus idle time slot length; Compare the bus idle time slot length with the nominal compensation duration corresponding to the restored original identifier. If the bus idle time slot length is greater than the nominal compensation duration, insert a micro time slot compensation bit with the same length as the nominal compensation duration before the data field start bit. When the length of the bus idle time slot is less than the nominal compensation duration, the corresponding micro-time slot compensation bits are truncated according to the length of the bus idle time slot and inserted, and the filling bits of the subsequent data field are shortened accordingly.

6. The intelligent connector communication system based on CAN bus according to claim 2, characterized in that, The process of the parsing component selecting the corresponding reference delay coefficient based on the bus occupancy interval and setting the weighted sum of the reference delay coefficient and the single frame transmission time as the dynamic delay threshold includes: setting multiple consecutive bus occupancy intervals, configuring an independent reference delay coefficient for each bus occupancy interval, and gradually decreasing the corresponding reference delay coefficient as the value of the bus occupancy interval increases. The bus occupancy rate is tracked in real time within the most recent preset number of sampling periods. When the bus occupancy rate crosses the bus occupancy rate range, the reference delay coefficient is switched. The dynamic delay threshold is updated by weighted summation of the switched reference delay coefficient and the single frame transmission time of the current sampling period, so as to shorten the waiting time for low priority frames to trigger priority transition under high load.

7. The intelligent connector communication system based on CAN bus according to claim 3, characterized in that, The reconstruction component performs a circular left shift operation on the original identifier of the low-priority message arbitration field, extracts the shift-out bit to generate an additional check bit, and concatenates the shift-out bit and the additional check bit to form a shift code. The process includes: identifying the data type of the original identifier as a standard frame 11-bit identifier or an extended frame 29-bit identifier. A first predetermined number of cyclic left shift operations are performed on the 11-bit identifier of the standard frame, and a second predetermined number of cyclic left shift operations are performed on the 29-bit identifier of the extended frame. Extract the overflow bit generated by the circular left shift operation, calculate the parity value of the overflow bit as the additional parity bit, concatenate the overflow bit before the parity value to form the shift code, and add an identifier bit to the beginning of the shift code to distinguish the data type, so as to avoid misjudgment of the identifier length during parsing at the receiving end.

8. The intelligent connector communication system based on CAN bus according to claim 4, characterized in that, The process by which the recovery component performs a cyclic right shift operation and an additional check bit comparison on the shifted code to restore the original identifier includes: separating the overflow bit and the additional check bit from the extracted shifted code, performing a reverse cyclic right shift operation corresponding to the cyclic left shift operation on the separated overflow bit, and generating a candidate original identifier; Based on the generated candidate original identifier, the parity check value is recalculated, and the recalculated parity check value is compared with the separated additional check bits. If the comparison is inconsistent, it is determined that the shift code was damaged during bus transmission, the current message is discarded and the reconstruction component is triggered to re-execute the shift code and embedding operation of the original identifier; If the comparison matches, the candidate original identifier is confirmed to be the restored original identifier.

9. A smart connector communication system based on a CAN bus according to claim 1, characterized in that, The system also includes a receiver parsing component, which is used to monitor the message frame structure at the CAN bus receiver. When a micro-timeslot compensation bit is detected before the start bit of the message data field, the micro-timeslot compensation bit is extracted to measure the actual idle timeslot length, and the sampling point phase of the local bit timer is calibrated using the actual idle timeslot length. The shift code at the beginning of the first byte of the data field is extracted synchronously to restore the original identifier. The restored original identifier is then filled back into the arbitration field identifier field. The micro-slot compensation bit and shift code bit are stripped off and reassembled into a standard message format conforming to the CAN bus protocol. The reassembled standard message format is then submitted to the upper-layer protocol stack of the receiving end.

10. A smart connector communication system based on a CAN bus according to claim 1, characterized in that, The system also includes a multi-node collaboration component, which is used to establish a token passing mechanism among multiple smart connectors deployed in a CAN bus network. When any smart connector triggers low-priority message interception and arbitration field identifier replacement, a bus occupancy request frame containing the local node identifier and the duration of virtual identifier occupation is generated and broadcast to the network. After receiving the bus occupancy request frame, other smart connectors suspend their local arbitration field identifier replacement operation and record the occupancy status of the smart connector that sent the bus occupancy request frame in their locally maintained occupancy status table. When the virtual identifier's occupancy time expires or a confirmation frame is received from the smart connector that sent the bus occupancy request frame to release the occupancy, the corresponding record in the occupancy status table is deleted, and the local arbitration field identifier replacement operation is resumed to avoid multiple smart connectors using the same high-priority virtual identifier at the same time, which could cause bus arbitration conflicts.