Protocol conversion method, device and equipment for controller area network and time-sensitive network

By listening to messages on the CAN bus, calculating the average response period, and using them as the sampling period of TSN frames, the problem of high computational complexity when connecting CAN and TSN networks is solved, and effective conversion of CAN messages and simplification of traffic scheduling is achieved.

CN119697273AActive Publication Date: 2025-03-25PURPLE MOUNTAIN LAB
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411518987.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-29
Publication Date
2025-03-25
Estimated Expiration
2044-10-29

AI Technical Summary

Technical Problem

During the docking and convergence process of CAN network and TSN network, it is necessary to convert CAN packets into TSN frames, and at the same time, the periodic information of the CAN data stream is understood to match the gated list scheduling of the TSN switch, resulting in high computational complexity.

Method used

By listening to messages transmitted on the CAN bus, recording the sending time and message content, calculating the average response period, using it as the sampling period of the TSN frame, and participating in the traffic scheduling planning of the TSN as a periodic data stream.

Benefits of technology

It realizes the conversion of random burst CAN messages into TSN frames with unified sampling period, reducing the computational complexity of traffic scheduling planning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119697273A_ABST
    Figure CN119697273A_ABST
Patent Text Reader

Abstract

The invention provides a protocol conversion method, device and equipment for a controller local area network and a time-sensitive network, and relates to the technical field of network communication, the method comprises the following steps: monitoring controller local area network messages transmitted on a controller local area network bus, and recording the sending time and the message content of a plurality of controller local area network messages; determining an average response period based on the sending time of each controller local area network message; for each controller local area network message, converting the message content of the controller local area network message into a time-sensitive network frame; and taking the average response period as a sampling period of each time-sensitive network frame, and sending each time-sensitive network frame on the time-sensitive network according to the sampling period. According to the invention, the random burst controller local area network messages can be converted into the time-sensitive network frames with the unified sampling period, and the plurality of controller local area network messages are taken as a periodic data stream to participate in the traffic scheduling planning of the time-sensitive network, so that the calculation complexity of the traffic scheduling planning can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of network communication technology, and in particular to a method, device and equipment for converting a controller area network (CAR) to a time-sensitive network (TSN) protocol. Background Art

[0002] The Controller Area Network (CAN) bus is a protocol widely used in real-time communication systems. It has the advantages of strong real-time performance, long transmission distance, and strong anti-electromagnetic interference. However, with the increasing complexity of the system and the improvement of real-time requirements, the traditional CAN bus may not meet the needs in some scenarios. As an emerging network technology, Time-Sensitive Networking (TSN) provides stronger real-time and deterministic performance and is suitable for time-sensitive application scenarios. However, due to the significant differences between CAN and TSN in protocol structure and communication mechanism, achieving seamless conversion between the two has become a technical challenge.

[0003] At present, the technology for converting CAN messages into TSN frames is very mature, but since the data stream needs to be shaped and scheduled after entering the TSN network, during the integration of the CAN network and the TSN network, it is necessary to convert the message data of the CAN network into TSN frames, and at the same time, it is necessary to know the periodic information of the CAN data stream to match the periodic gating list scheduling of the TSN switch. When there are many CAN devices and the CAN messages have the characteristics of random bursts, if the CAN data stream sent by each CAN node is processed separately, then various CAN data streams with different periods will appear on the TSN side. If these data streams are mixed with the data streams in TSN, the overall flow data will increase significantly, which will bring serious high-complexity calculation problems to traffic scheduling planning. Summary of the invention

[0004] The present invention provides a method, device and equipment for converting a controller area network (CAN) and a time-sensitive network (TSN) protocol, which are used to convert randomly bursty CAN messages into TSN frames with a uniform sampling period, and treat multiple CAN messages as a periodic data stream to participate in the traffic scheduling planning of the TSN, thereby reducing the computational complexity of the traffic scheduling planning.

[0005] The present invention provides a method for converting a controller area network (CAR) and a time-sensitive network (TSN) protocol, which is applied to a controller area network-time-sensitive network (TSN) gateway. The method comprises: Monitoring controller area network messages transmitted on the controller area network bus, and recording the sending time and message content of a plurality of the controller area network messages; Determining an average response period based on the sending time of each of the controller area network messages; For each of the controller area network messages, converting the message content of the controller area network message into a time-sensitive network frame; The average response period is used as a sampling period of each of the time-sensitive network frames, and each of the time-sensitive network frames is sent on the time-sensitive network according to the sampling period.

[0006] According to a method for converting a controller area network and a time-sensitive network protocol provided by the present invention, the average response period is determined based on the sending time of each controller area network message, including: Counting the time interval between the sending times of two adjacent controller area network messages; An average value of each of the sending time intervals is calculated as the average response period.

[0007] According to a method for converting a controller area network (CAN) and a time-sensitive network (TSN) protocol, the method further includes: if the average response period is greater than the sending period of any of the controller area network messages, adjusting the sampling period to the minimum sending period of the sending periods of the controller area network messages.

[0008] According to a method for converting a controller area network and a time-sensitive network protocol provided by the present invention, the method further includes: if the average response period is greater than the worst response time of the controller area network message, the sampling period is adjusted to any positive integer time that is half or less than half of the worst response time of the controller area network message; the worst response time is the longest response time specified by the business requirements.

[0009] According to a method for converting a controller area network (CAR) to a time-sensitive network (TSN) protocol, the method further includes: if the sending period of the CAR message is not an integer multiple of the average response period, adjusting the sampling period to the greatest common divisor of the sending periods of the CAR messages.

[0010] According to a method for converting a controller area network and a time-sensitive network protocol provided by the present invention, the recording of the sending time and message content of a plurality of controller area network messages includes: Recording the sending time and message content of multiple controller local area network messages within a custom time period; or,

[0011] The sending time and message content of the controller local area network message of the custom message quantity are recorded.

[0012] The present invention also provides a controller area network and time-sensitive network protocol conversion device, which is applied to a controller area network-time-sensitive network gateway, and the device includes: A monitoring module, used for monitoring the CAN messages transmitted on the CAN bus; A recording module, used to record the sending time and message content of multiple controller local area network messages; A determination module, configured to determine an average response period based on a sending time of each of the controller area network messages; A conversion module, configured to convert the message content of each controller area network message into a time-sensitive network frame; The sending module is used to use the average response period as a sampling period of each time-sensitive network frame, and send each time-sensitive network frame on the time-sensitive network according to the sampling period.

[0013] The present invention also provides a controller area network-time-sensitive network gateway, comprising: a plurality of controller area network interfaces, a plurality of controller area network message receiving buffers corresponding one-to-one to the plurality of controller area network interfaces, a controller area network message cycle learner, a controller area network-time-sensitive network encapsulator, a scheduler, a plurality of Ethernet ports, and a plurality of time-sensitive network queue sending buffers corresponding one-to-one to the plurality of Ethernet ports; wherein: The controller area network message receiving buffer is used to receive and cache the sending time and message content of the controller area network message entering from the corresponding controller area network interface; The CAN message period learner is connected to each of the CAN message receiving buffers and is used to determine an average response period based on the sending time of a plurality of the CAN messages; The CAN-TSN encapsulator is connected to each CAN message receiving buffer, and is used to parse the message content of the CAN message for each CAN message, obtain the corresponding Ethernet port, and encapsulate the message content of the CAN message into a TSN frame; The scheduler is respectively connected to the controller area network message period learner, the controller area network-time-sensitive network encapsulator and each time-sensitive network queue sending buffer, and is used to schedule the time-sensitive network frame to the corresponding time-sensitive network queue sending buffer for each time-sensitive network frame, and use the average response period as the sampling period of the time-sensitive network frame, and send the time-sensitive network frame in the time-sensitive network queue sending buffer from the corresponding Ethernet port according to the sampling period.

[0014] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the controller area network and time-sensitive network protocol conversion method as described in any one of the above is implemented.

[0015] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for converting a controller area network to a time-sensitive network protocol as described in any one of the above is implemented.

[0016] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the method for converting a controller area network to a time-sensitive network protocol as described in any one of the above is implemented.

[0017] The controller LAN and time-sensitive network protocol conversion method, device and equipment provided by the present invention first monitor the controller LAN message transmitted on the controller LAN bus, and record the sending time and message content of multiple controller LAN messages; then, determine the average response period based on the sending time of each controller LAN message; then, for each controller LAN message, convert the message content of the controller LAN message into a time-sensitive network frame; finally, use the average response period as the sampling period of each time-sensitive network frame, and send each time-sensitive network frame on the time-sensitive network according to the sampling period, so that randomly burst controller LAN messages can be converted into time-sensitive network frames with a uniform sampling period, and multiple controller LAN messages are regarded as a periodic data stream to participate in the traffic scheduling planning of the time-sensitive network, which can reduce the computational complexity of the traffic scheduling planning. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0019] Figure 1 It is a flowchart of a method for converting a controller area network and a time-sensitive network protocol provided by an embodiment of the present invention.

[0020] Figure 2 It is a schematic diagram of a CAN network communicating through a CAN-TSN gateway provided by an embodiment of the present invention.

[0021] Figure 3It is a schematic diagram of the structure of a controller area network and a time-sensitive network protocol conversion device provided by an embodiment of the present invention.

[0022] Figure 4 It is a schematic diagram of converting CAN messages into TSN frames in a CAN-TSN gateway provided by an embodiment of the present invention.

[0023] Figure 5 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0024] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0025] Combine the following Figure 1-Figure 2 The present invention describes the controller area network and time-sensitive network protocol conversion method.

[0026] Please refer to Figure 1 , Figure 1 1 is a flow chart of a method for converting a controller area network and a time-sensitive network protocol provided by an embodiment of the present invention. The method is applied to a CAN-TSN gateway, such as Figure 1 As shown, the method includes steps 101 to 104.

[0027] Step 101: monitor CAN messages transmitted on a CAN bus, and record the sending time and message contents of multiple CAN messages.

[0028] Specifically, Figure 2 As shown in the figure, in an industrial automation system, there are multiple CAN nodes (for example, various sensors and actuators) communicating through the CAN bus. The CAN-TSN gateway monitors the CAN messages transmitted on the CAN bus and records the sending time and message content of each CAN message.

[0029] Optionally, recording the sending time and message content of multiple controller area network messages includes: recording the sending time and message content of multiple controller area network messages within a custom duration; or recording the sending time and message content of a custom number of controller area network messages.

[0030] For example, assuming that the custom duration is 1 second, the sending time and message content of multiple CAN messages within 1 second are recorded. Alternatively, assuming that the number of custom messages is 10,000, the sending time and message content of 10,000 CAN messages are recorded.

[0031] Step 102: Determine an average response period based on the sending time of each controller LAN message.

[0032] Specifically, the CAN-TSN gateway calculates the average response period according to the recorded sending time of each CAN message.

[0033] Optionally, step 102 includes: counting the sending time intervals between the sending times of two adjacent controller area network messages; and calculating the average value of each sending time interval as the average response period.

[0034] Step 103: For each CAN message, convert the message content of the CAN message into a time-sensitive network frame.

[0035] Specifically, in order to improve the real-time and deterministic performance of the system, the CAN-TSN gateway maps the data fields of the message content of each recorded CAN message to the corresponding fields of the TSN frame and maintains the timing relationship of the messages, thereby converting the message content of each CAN message into a TSN frame.

[0036] Step 104: Use the average response period as a sampling period of each time-sensitive network frame, and send each time-sensitive network frame on the time-sensitive network according to the sampling period.

[0037] Specifically, Figure 2 As shown in the figure, the CAN-TSN gateway uses the average response period as the sampling period of each TSN frame. The sampling period determines the sending frequency or time interval of the TSN message, and each TSN frame is sent on the TSN network according to a unified sampling period. In this way, all CAN messages connected to the CAN-TSN gateway are transmitted with the same sampling period, thus achieving seamless conversion between CAN and TSN protocols.

[0038] The method for converting the controller LAN and time-sensitive network protocols provided in an embodiment of the present invention first monitors the controller LAN messages transmitted on the controller LAN bus, and records the sending time and message content of multiple controller LAN messages; then, determines the average response period based on the sending time of each controller LAN message; then, for each controller LAN message, converts the message content of the controller LAN message into a time-sensitive network frame; finally, uses the average response period as the sampling period of each time-sensitive network frame, and sends each time-sensitive network frame on the time-sensitive network according to the sampling period, so that randomly burst controller LAN messages can be converted into time-sensitive network frames with a uniform sampling period, and multiple controller LAN messages are regarded as a periodic data stream to participate in the traffic scheduling planning of the time-sensitive network, which can reduce the computational complexity of the traffic scheduling planning.

[0039] In one embodiment, the method further includes: if the average response period is greater than the sending period of any CAN message, adjusting the sampling period to the minimum sending period of the sending periods of the CAN messages.

[0040] Specifically, if the calculated average response period is greater than the sending period of any CAN message, it means that the calculated average response period cannot carry the sending period of the CAN message. The sampling period can be adjusted to the minimum sending period among the sending periods of each CAN message, and the CAN message can be saturated sampled.

[0041] In one embodiment, the method further includes: if the average response period is greater than the worst response time of the CAN message, adjusting the sampling period to any positive integer time that is half or less than half of the worst response time of the CAN message. The worst response time is the longest response time specified by the business requirements.

[0042] Exemplarily, the worst response time is the longest response time specified by the business requirements. If the calculated average response period is 16ms and the worst response time of the CAN message is 10ms, then the calculated average response period is greater than the worst response time of the CAN message, which means that the calculated average response period cannot carry the sending period of the CAN message. The sampling period can be adjusted to 5ms or any positive integer time below 5ms, and the CAN message can be saturated sampled.

[0043] In one embodiment, the method further includes: if the transmission period of the CAN message is not an integer multiple of the average response period, adjusting the sampling period to the greatest common divisor of the transmission periods of the CAN messages.

[0044] For example, if the calculated average response period is 13ms, and the sending period of the CAN message is 5ms, 20ms, and 8ms, the sending period of the CAN message is not an integer multiple of the average response period. In this case, the sampling period is adjusted to the greatest common divisor of the sending periods of each CAN message, 1ms, to meet the requirements of the scenario where the sending period of the CAN message is strictly required to be an integer multiple of the sampling period.

[0045] The controller area network and time-sensitive network protocol conversion device provided by the present invention is described below. The controller area network and time-sensitive network protocol conversion device described below and the controller area network and time-sensitive network protocol conversion method described above can be referenced to each other.

[0046] Please refer to Figure 3 , Figure 3 1 is a schematic diagram of the structure of a controller area network and a time-sensitive network protocol conversion device provided by an embodiment of the present invention. The device is applied to a CAN-TSN gateway, such as Figure 3 As shown, the device may include: A monitoring module 10, used for monitoring the CAN messages transmitted on the CAN bus; A recording module 20, used to record the sending time and message content of multiple controller local area network messages; A determination module 30, configured to determine an average response period based on the transmission time of each controller local area network message; The conversion module 40 is used to convert the message content of the controller area network message into a time-sensitive network frame for each controller area network message; The sending module 50 is used to use the average response period as the sampling period of each time-sensitive network frame, and send each time-sensitive network frame on the time-sensitive network according to the sampling period.

[0047] In one embodiment, the determination module 30 is specifically configured to: Counting the time interval between the sending times of the local area network messages of two adjacent controllers; The average of the sending time intervals is calculated as the average response period.

[0048] In one embodiment, the apparatus further comprises: The first adjustment module is used to adjust the sampling period to the minimum sending period of the sending periods of the controller area network messages if the average response period is greater than the sending period of any controller area network message.

[0049] In one embodiment, the device further comprises: The second adjustment module is used to adjust the sampling period to any positive integer time of half or less than half of the worst response time of the controller area network message if the average response period is greater than the worst response time of the controller area network message; the worst response time is the longest response time specified by the business requirements.

[0050] In one embodiment, the device further comprises: The third adjustment module is used to adjust the sampling period to the greatest common divisor of the sending periods of the LAN messages if the sending period of the LAN messages is not an integer multiple of the average response period.

[0051] In one embodiment, the recording module 20 is specifically used for: Record the sending time and content of multiple Controller Area Network messages within a custom duration; or,

[0052] Record the sending time and message content of the controller LAN message with a custom number of messages.

[0053] Please refer to Figure 4 , Figure 4 FIG. 1 is a schematic diagram of converting CAN messages into TSN frames in a CAN-TSN gateway provided by an embodiment of the present invention. Figure 4 As shown, the CAN-TSN gateway includes: multiple CAN interfaces, multiple CAN message receiving buffers corresponding to the multiple CAN interfaces, a CAN message cycle learner, a CAN-TSN encapsulator, a scheduler, multiple Ethernet (ETH) ports, and multiple TSN queue sending buffers corresponding to the multiple ETH ports; wherein: CAN message receiving buffer, used to receive and cache the sending time and message content of the CAN message entering from the corresponding CAN interface; A CAN message cycle learner connected to each CAN message receiving buffer for determining an average response cycle based on the transmission time of multiple CAN messages; A CAN-TSN encapsulator is connected to each CAN message receiving buffer, and is used to parse the message content of each CAN message, obtain the corresponding ETH port, and encapsulate the message content of the CAN message into a TSN frame; The scheduler is connected to the CAN message cycle learner, the CAN-TSN encapsulator and each TSN queue sending buffer respectively, and is used to schedule the TSN frame to the corresponding TSN queue sending buffer for each TSN frame, and use the average response cycle as the sampling period of the TSN frame, and send the TSN frame in the TSN queue sending buffer from the corresponding ETH port according to the sampling period.

[0054] Optionally, the port exchange table is used to store a mapping relationship between a CAN interface and an ETH port.

[0055] In one embodiment, the CAN message cycle learner is specifically used for: Counting the time interval between the sending times of the local area network messages of two adjacent controllers; The average of the sending time intervals is calculated as the average response period.

[0056] In one embodiment, the CAN message cycle learner is further used for: If the average response period is greater than the sending period of any controller area network message, the sampling period is adjusted to the minimum sending period of the sending periods of the controller area network messages.

[0057] In one embodiment, the CAN message cycle learner is further used for: If the average response period is greater than the worst response time of the LAN message, the sampling period is adjusted to half of the worst response time of the LAN message or any positive integer less than half; the worst response time is the longest response time specified by the business requirements.

[0058] In one embodiment, the CAN message cycle learner is further used for: If the transmission period of the CAN message is not an integer multiple of the average response period, the sampling period is adjusted to the least common multiple of the transmission periods of the CAN messages.

[0059] In one embodiment, the CAN message receiving buffer is specifically used for: Record the sending time and content of multiple Controller Area Network messages within a custom duration; or,

[0060] Record the sending time and message content of the controller LAN message with a custom number of messages.

[0061] Figure 5 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 5As shown, the electronic device may include: a processor 510, a communication interface 520, a memory 530 and a communication bus 540, wherein the processor 510, the communication interface 520 and the memory 530 communicate with each other through the communication bus 540. The processor 510 may call the logic instructions in the memory 530 to execute the controller area network and time-sensitive network protocol conversion method, the method comprising: monitoring the controller area network message transmitted on the controller area network bus, and recording the sending time and message content of multiple controller area network messages; determining the average response period based on the sending time of each controller area network message; for each controller area network message, converting the message content of the controller area network message into a time-sensitive network frame; using the average response period as the sampling period of each time-sensitive network frame, and sending each time-sensitive network frame on the time-sensitive network according to the sampling period.

[0062] In addition, the logic instructions in the above-mentioned memory 530 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0063] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the controller area network and time-sensitive network protocol conversion method provided by the above-mentioned method embodiments. The method includes: monitoring controller area network messages transmitted on the controller area network bus, and recording the sending time and message content of multiple controller area network messages; determining an average response period based on the sending time of each controller area network message; for each controller area network message, converting the message content of the controller area network message into a time-sensitive network frame; using the average response period as the sampling period of each time-sensitive network frame, and sending each time-sensitive network frame on the time-sensitive network according to the sampling period.

[0064] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it is implemented to execute the controller area network and time-sensitive network protocol conversion method provided by the above-mentioned method embodiments. The method includes: monitoring controller area network messages transmitted on the controller area network bus, and recording the sending time and message content of multiple controller area network messages; determining an average response period based on the sending time of each controller area network message; for each controller area network message, converting the message content of the controller area network message into a time-sensitive network frame; using the average response period as the sampling period of each time-sensitive network frame, and sending each time-sensitive network frame on the time-sensitive network according to the sampling period.

[0065] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0066] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0067] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for converting a controller area network to a time-sensitive network protocol, characterized in that: Applied to a controller area network-time sensitive network gateway, the method comprises: Monitoring controller area network messages transmitted on the controller area network bus, and recording the sending time and message content of a plurality of the controller area network messages; Determining an average response period based on the sending time of each of the controller area network messages; For each of the controller area network messages, converting the message content of the controller area network message into a time-sensitive network frame; The average response period is used as a sampling period of each of the time-sensitive network frames, and each of the time-sensitive network frames is sent on the time-sensitive network according to the sampling period.

2. The method for converting a controller area network to a time-sensitive network protocol according to claim 1, characterized in that: The determining the average response period based on the sending time of each of the controller area network messages includes: Counting the time interval between the sending times of two adjacent controller area network messages; An average value of each of the sending time intervals is calculated as the average response period.

3. The method for converting a controller area network to a time-sensitive network protocol according to claim 1 or 2, characterized in that: Also includes: If the average response period is greater than the sending period of any of the CAN messages, the sampling period is adjusted to be the minimum sending period of the sending periods of the CAN messages.

4. The method for converting a controller area network to a time-sensitive network protocol according to claim 1 or 2, characterized in that: Also includes: If the average response period is greater than the worst response time of the CAN message, the sampling period is adjusted to any positive integer time that is half or less than half of the worst response time of the CAN message; the worst response time is the longest response time specified by the business requirements.

5. The method for converting a controller area network to a time-sensitive network protocol according to claim 1 or 2, characterized in that: Also includes: If the transmission period of the CAN message is not an integer multiple of the average response period, the sampling period is adjusted to the greatest common divisor of the transmission periods of the CAN messages.

6. The method for converting a controller area network to a time-sensitive network protocol according to claim 1, characterized in that: The recording of the sending time and message content of the plurality of controller area network messages includes: Recording the sending time and message content of multiple controller local area network messages within a custom time period; or, The sending time and message content of the controller local area network message of the custom message quantity are recorded.

7. A controller area network and time-sensitive network protocol conversion device, characterized in that: Applied to a controller area network-time sensitive network gateway, the device comprises: A monitoring module, used for monitoring the CAN messages transmitted on the CAN bus; A recording module, used to record the sending time and message content of multiple controller local area network messages; A determination module, configured to determine an average response period based on a sending time of each of the controller area network messages; A conversion module, configured to convert the message content of each controller area network message into a time-sensitive network frame; The sending module is used to use the average response period as a sampling period of each time-sensitive network frame, and send each time-sensitive network frame on the time-sensitive network according to the sampling period.

8. A controller area network-time sensitive network gateway, characterized in that: include: A plurality of controller area network interfaces, a plurality of controller area network message receiving buffers corresponding one-to-one to the plurality of controller area network interfaces, a controller area network message cycle learner, a controller area network-time-sensitive network encapsulator, a scheduler, a plurality of Ethernet ports, and a plurality of time-sensitive network queue sending buffers corresponding one-to-one to the plurality of Ethernet ports; wherein: The controller area network message receiving buffer is used to receive and cache the sending time and message content of the controller area network message entering from the corresponding controller area network interface; The CAN message period learner is connected to each of the CAN message receiving buffers and is used to determine an average response period based on the sending time of a plurality of the CAN messages; The CAN-TSN encapsulator is connected to each CAN message receiving buffer, and is used to parse the message content of the CAN message for each CAN message, obtain the corresponding Ethernet port, and encapsulate the message content of the CAN message into a TSN frame; The scheduler is respectively connected to the controller area network message period learner, the controller area network-time-sensitive network encapsulator and each time-sensitive network queue sending buffer, and is used to schedule the time-sensitive network frame to the corresponding time-sensitive network queue sending buffer for each time-sensitive network frame, and use the average response period as the sampling period of the time-sensitive network frame, and send the time-sensitive network frame in the time-sensitive network queue sending buffer from the corresponding Ethernet port according to the sampling period.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the method for converting a controller area network to a time-sensitive network protocol as described in any one of claims 1 to 6 is implemented.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for converting a controller area network to a time-sensitive network protocol as claimed in any one of claims 1 to 6 is implemented.

11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for converting a controller area network to a time-sensitive network protocol as claimed in any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Data exchange device for merging CAN bus into time sensitive network and network

    CN111464409A

  • Process layer network communication method, device and system based on TSN, and TSN controller

    CN115484140A

  • Time-sensitive networking support on sidelinks

    CN117322073A

  • Time-sensitive network traffic scheduling method for digital substation

    CN118175116A

  • Methods and apparatus for adjusting wireless communication structure

    IN202047027547A